<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sumant Sogikar on Medium]]></title>
        <description><![CDATA[Stories by Sumant Sogikar on Medium]]></description>
        <link>https://medium.com/@sumant1122?source=rss-c21ed862b5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xiOLLcn1Mui4UrVvQm-yug.png</url>
            <title>Stories by Sumant Sogikar on Medium</title>
            <link>https://medium.com/@sumant1122?source=rss-c21ed862b5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:36:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sumant1122/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why I Built a Lightweight SSH Alternative in Rust for My 2GB RAM Laptop]]></title>
            <link>https://medium.com/the-repo/why-i-built-a-lightweight-ssh-alternative-in-rust-for-my-2gb-ram-laptop-220249ee85f6?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/220249ee85f6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 13:52:23 GMT</pubDate>
            <atom:updated>2026-12-04T08:09:58.411Z</atom:updated>
            <content:encoded><![CDATA[<h4>Replacing OpenSSH with a 1.0 MB binary that uses 2.5 MB of RAM and opens a shell in 1 RTT.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*beQwKuPEV-HxA-is" /><figcaption>Photo by <a href="https://unsplash.com/@back2gaming?utm_source=medium&amp;utm_medium=referral">Back2Gaming</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The Problem: When OpenSSH is Too Heavy for Revived Hardware</h4><p>I recently decided to give my old laptop a second life as a headless Linux server to access from my Mac. It has 2 GB of RAM and an older dual-core processor without modern instruction sets.</p><p>While 2 GB sounds like plenty for a headless CLI machine, memory disappears fast when running background tasks, containers, or light databases. Then there’s OpenSSH:</p><ol><li><strong>The Memory Tax:</strong> Standard OpenSSH (sshd) utilizes a privilege-separated architecture (sshd: [priv], an unprivileged user process, PAM sessions, and user shells). Each active session typically consumes <strong>18 MB to 30 MB of Resident Memory (RSS)</strong>. On a machine near memory exhaustion, that triggers swap thrashing.</li><li><strong>The CPU Bottleneck:</strong> Older CPUs (Atom, early Celerons, Core 2 Duo) lack hardware AES-NI crypto acceleration. Software AES can saturate an old CPU just encrypting network buffers.</li><li><strong>Handshake Latency:</strong> RFC 4253 OpenSSH requires <strong>5 to 7 round-trips</strong> (KEXINIT, Diffie-Hellman, service requests, auth exchanges, channel opens). Over local Wi-Fi or high-latency links, there is a visible delay before the prompt appears.</li></ol><p>I wanted something simpler: a secure, single-binary remote shell that compiles to ~1 MB, uses less than 3 MB of RAM, launches in 1 round-trip, and feels instant.</p><p>So, I built <a href="https://github.com/sumant1122/nanossh"><strong>nanossh</strong></a> in Rust.</p><h3>Designing nanossh</h3><p>Instead of reimplementing all of RFC 4254 (channels, X11 forwarding, SFTP subsystems, agent forwarding), nanossh focuses on doing one thing exceptionally well: <strong>providing an encrypted, interactive pseudo-terminal (PTY) with zero configuration.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVYAkJ0iiSk0FbkVpmRdgA.png" /></figure><h4>1. Why ChaCha20-Poly1305?</h4><p>Rather than defaulting to AES-GCM, nanossh uses ChaCha20-Poly1305 authenticated encryption (AEAD). ChaCha20 relies purely on standard 32-bit addition, rotation, and XOR operations (ARX). It runs at 400–600+ MB/s even on older processors without specialized crypto instructions, with zero vulnerability to cache-timing attacks.</p><h4>2. 1-RTT Handshake</h4><p>Both sides generate ephemeral <strong>X25519</strong> keypairs, exchange them in a single round-trip, and authenticate via HMAC-SHA256 using a pre-shared token. From there, two independent 256-bit keys and monotonic sequence counters are derived via HKDF-SHA256 for bidirectional streaming.</p><h4>3. Real PTY &amp; Dynamic Window Resize</h4><p>A common pitfall with DIY remote shells is raw stdout piping without a true PTY (breaking vim, htop, Tab-completion, and Ctrl+C).</p><p>nanossh allocates a real pseudo-terminal on the server. On the client, it puts the terminal into raw mode and hooks SIGWINCH. When you resize your Mac terminal window, a PTY_RESIZE frame is sent across the wire, invoking ioctl(TIOCSWINSZ) on the remote PTY so fullscreen terminal apps re-render dynamically.</p><h3>The Benchmarks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hibcNx0Qnep6F3paJLE_aQ.png" /></figure><h3>Where Else Is This Useful?</h3><p>Beyond reviving old 2GB laptops, this lightweight architecture is ideal for:</p><ol><li><strong>Embedded Linux &amp; Raspberry Pi Zero:</strong> Minimal flash storage and low RAM environments where dragging in OpenSSL is prohibitive.</li><li><strong>Satellite &amp; Cellular Links:</strong> When network RTT is 500ms+, cutting 6 handshake round-trips saves 3 full seconds on connection setup.</li><li><strong>Initramfs (Early-Boot LUKS Decryption):</strong> A 1MB static binary fits easily inside an early boot ramdisk to unlock encrypted disks remotely before the main OS boots.</li><li><strong>Minimal Containers (Alpine/Distroless):</strong> Quick interactive debugging without bloating container images with openssh-server.</li></ol><h3>Try It Out</h3><p>The project is completely open source under MIT/Apache-2.0:</p><p><strong>GitHub:</strong> <a href="https://github.com/sumant1122/nanossh">https://github.com/sumant1122/nanossh</a></p><p><em>If you have an old laptop, a Raspberry Pi Zero, or an edge node collecting dust, give it a spin!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=220249ee85f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-repo/why-i-built-a-lightweight-ssh-alternative-in-rust-for-my-2gb-ram-laptop-220249ee85f6">Why I Built a Lightweight SSH Alternative in Rust for My 2GB RAM Laptop</a> was originally published in <a href="https://medium.com/the-repo">The Repo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Got Tired of Docker Desktop Eating 4GB of RAM on My Mac.  So I built my own Container Runtime]]></title>
            <link>https://medium.com/@sumant1122/i-got-tired-of-docker-desktop-eating-4gb-of-ram-on-my-mac-so-i-built-my-own-container-runtime-272ace2d9e50?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/272ace2d9e50</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 16:22:49 GMT</pubDate>
            <atom:updated>2026-10-31T16:22:49.962Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Got Tired of Docker Desktop Eating 4GB of RAM on My Mac. So I Built My Own Container Runtime in Rust.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PQ0Y5es5ZDBMSekQ" /><figcaption>Photo by <a href="https://unsplash.com/@ventiviews?utm_source=medium&amp;utm_medium=referral">Venti Views</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Zero Docker Engine. Zero containerd. Sub-second boot times. Here is how Maclet implements Linux namespaces, cgroups v2, and OverlayFS natively on Apple Silicon.</p><p>Like millions of engineers, I love my Apple Silicon MacBook. The performance-per-watt is unmatched, battery life lasts all day, and everything feels instantaneous — until you launch Docker Desktop.</p><p>Within minutes:</p><ul><li>An Electron app idles in the background, devouring <strong>2 to 4 GB of RAM</strong>.</li><li>Battery life visibly drops.</li><li>Multiple background daemons (dockerd, containerd, docker-proxy, license checking services, telemetry engines) take over your process table.</li></ul><p>Of course, alternatives exist. Tools like <strong>Colima</strong>, <strong>Lima</strong>, and <strong>OrbStack</strong> have made great strides. But if you look under their hoods, they are almost universally <strong>VM orchestration wrappers</strong> that provision a virtual machine and run standard containerd or Docker Engine inside it.</p><p>I asked myself a fundamental systems engineering question:</p><blockquote><strong><em>What does it take to build a container runtime from scratch specifically for macOS, without using Docker Desktop, containerd, or runc?</em></strong></blockquote><p>The result is <a href="https://github.com/sumant1122/maclet"><strong>Maclet</strong></a>: a container runtime written in Rust and Swift that owns the entire orchestration and isolation lifecycle down to the Linux syscalls. The host CLI is a single <strong>~3.6 MB binary</strong>, the micro-VM boots in <strong>under 800ms</strong>, and idle memory sits at <strong>under 150 MB</strong>.</p><p>Here is how it was built, the architectural hurdles of macOS, and what genuine container isolation looks like under the hood.</p><h3>1. The Fundamental Constraint: macOS Has No Namespaces</h3><p>Before writing a single line of Rust, we must address the fundamental constraint of containerization on Darwin: <strong>macOS is not Linux</strong>.</p><p>Containers are not real things. A “container” is simply a regular Linux process wrapped in:</p><ol><li><strong>Namespaces</strong> (isolating what the process can <em>see</em>: PIDs, mounts, network interfaces, hostnames).</li><li><strong>Control Groups (cgroups v2)</strong> (restricting what the process can <em>use</em>: CPU quotas, memory limits, process counts).</li><li><strong>OverlayFS</strong> (providing a layered copy-on-write filesystem).</li><li><strong>pivot_root</strong> (locking the process into its isolated filesystem root).</li></ol><p>Because macOS lacks these kernel primitives, Maclet uses a clean <strong>Host / Guest split architecture</strong>:</p><pre>maclet CLI (macOS - Rust)<br>       │<br>       ▼ (Unix Domain Socket: ~/.maclet/maclet.sock)<br>maclet Daemon / maclet-vm<br>       │<br>       ▼ (Apple Virtualization Framework via Swift C-FFI)<br>Linux ARM64 Guest Micro-VM<br>       │<br>       ▼ (Virtio Console Channel: /dev/hvc1)<br>maclet-guest-agent (Static Rust binary as PID 1)<br>       │<br>       ├─► Linux Namespaces (PID, Mount, Net, IPC, UTS)<br>       ├─► cgroups v2 (cpu.max, memory.max, pids.max)<br>       ├─► Storage: OverlayFS (lower/upper/work/merged) &amp; pivot_root<br>       └─► Containerized Child Processes</pre><h3>2. Booting Linux in 800ms via Apple’s Virtualization Framework</h3><p>Rather than embedding QEMU or heavy hypervisor abstractions, Maclet speaks directly to Apple’s native <strong>Virtualization.framework</strong>.</p><p>Because the framework is written in Swift and Objective-C, Maclet bridges the macOS hypervisor using a thin, zero-overhead Swift C-FFI layer:</p><pre>// virtualization/apple-vz/Sources/apple_vz.swift<br>@_cdecl(&quot;vz_vm_create&quot;)<br>public func vz_vm_create(<br>    _ kernel_path: UnsafePointer&lt;CChar&gt;,<br>    _ initrd_path: UnsafePointer&lt;CChar&gt;,<br>    _ cmdline: UnsafePointer&lt;CChar&gt;,<br>    _ cpus: UInt32,<br>    _ memory_bytes: UInt64<br>) -&gt; UnsafeMutableRawPointer? {<br>    let bootLoader = VZLinuxBootLoader(kernelURL: kernelURL)<br>    bootLoader.initialRamdiskURL = initrdURL<br>    bootLoader.commandLine = commandLine<br><br>    let config = VZVirtualMachineConfiguration()<br>    config.bootLoader = bootLoader<br>    config.cpuCount = Int(cpus)<br>    config.memorySize = memory_bytes<br>    // Attach Virtio Console over a full-duplex Unix socketpair<br>    ...<br>}</pre><p>On the host side, Rust calls these FFI exports through maclet-vm.</p><p>Because we boot a lean 6.6.x ARM64 micro-kernel directly into memory without legacy BIOS, firmware stages, or systemd init overhead, the entire micro-VM boots and handshakes with the host in <strong>less than 800 milliseconds</strong>.</p><h3>3. The Guest Agent: Static Rust as PID 1</h3><p>Inside the Linux VM, Maclet does not run dockerd or containerd.</p><p>Instead, the initramfs contains a single statically linked musl binary: <strong>maclet-guest-agent</strong>. It boots as <strong>PID 1</strong>, mounts /dev, /proc, and /sys, configures loopback networking, and opens a dedicated Virtio Console channel (/dev/hvc1).</p><p>Host and guest communicate over this channel via a newline-delimited JSON-RPC wire protocol:</p><ul><li><strong>HostMessage</strong>: RunContainer, ExecInContainer, StopContainer, InspectContainer, ListContainers.</li><li><strong>GuestMessage</strong>: Ready, ContainerStarted, ContainerExecResult, ContainerList.</li></ul><h3>4. Genuine Linux Isolation From Scratch</h3><p>When you type:</p><pre>maclet run -d --name web-1 --memory 256m --cpus 1.5 -p 8080:80 alpine:latest /bin/sh</pre><p>Here is what happens inside the guest agent:</p><h3>A. Namespace Unsharing</h3><p>Maclet unshares kernel namespaces directly via Linux clone and setns flags:</p><pre>let clone_flags = libc::CLONE_NEWNS    // Mount namespace<br>                | libc::CLONE_NEWUTS   // Hostname isolation<br>                | libc::CLONE_NEWIPC   // Inter-process communication<br>                | libc::CLONE_NEWPID;  // PID namespace (container gets its own PID 1)</pre><h3>B. Filesystem Isolation via pivot_root</h3><p>Unlike a simple chroot (which can be escaped with root privileges), Maclet builds a dedicated mount tree and calls pivot_root:</p><pre>// Switch the current root directory to the new container rootfs<br>let ret = unsafe { libc::syscall(libc::SYS_pivot_root, new_root_c.as_ptr(), old_root_c.as_ptr()) };<br>if ret != 0 {<br>    return Err(MacletError::Guest(&quot;pivot_root failed&quot;.into()));<br>}<br><br>// Detach and unmount the old host root<br>unsafe { libc::umount2(b&quot;/.old_root\0&quot;.as_ptr() as *const _, libc::MNT_DETACH) };</pre><p>The container process now has its own fresh mount table containing its own /proc, /sys, and private /dev.</p><h3>C. Resource Enforcement with cgroups v2</h3><p>Maclet writes resource limits directly to the unified cgroups v2 hierarchy under /sys/fs/cgroup/maclet/&lt;container-id&gt;:</p><ul><li><strong>Memory</strong>: Writes bytes directly into memory.max.</li><li><strong>CPU Quota</strong>: Computes period and quota (e.g. 150000 100000 for 1.5 cores) and writes to cpu.max.</li><li><strong>PIDs Ceiling</strong>: Sets pids.max to prevent fork bombs.</li></ul><p>Live container accounting can be inspected with maclet stats:</p><pre>$ maclet stats web-1<br>CONTAINER ID     NAME     CPU %    MEM USAGE / LIMIT    PIDS<br>cnt-17934178     web-1    0.00%    0.49MB / 256.0MB     2</pre><h3>D. Per-Container Copy-on-Write with OverlayFS</h3><p>Every container gets its own isolated writable filesystem using Linux <strong>OverlayFS</strong>:</p><pre>lowerdir = /var/lib/maclet/rootfs         (Immutable base image layer)<br>upperdir = /var/lib/maclet/overlay/&lt;id&gt;/upper (Writable changes)<br>workdir  = /var/lib/maclet/overlay/&lt;id&gt;/work  (Scratch space)<br>target   = /var/lib/maclet/overlay/&lt;id&gt;/merged (Presented root)</pre><p>Any files written, modified, or deleted by the container exist exclusively in that container’s upper directory, keeping the underlying image pristine.</p><h3>E. Container Networking &amp; Bridge Masquerading</h3><p>Inside the Linux VM, Maclet sets up:</p><ol><li>A Linux bridge (maclet0) assigned to subnet 10.88.0.1/16.</li><li>A pair of virtual ethernet interfaces (veth_&lt;id&gt; on the bridge, ceth_&lt;id&gt; moved into the container&#39;s CLONE_NEWNET namespace and renamed eth0).</li><li>IPAM allocation and default route configuration.</li><li>iptables NAT masquerading rules so containers can seamlessly access the public internet.</li></ol><p>A container running on Maclet can resolve DNS and reach the external web immediately:</p><pre>$ maclet run alpine:latest ping -c 3 google.com<br>PING google.com (142.250.190.46): 56 data bytes<br>64 bytes from 142.250.190.46: seq=0 ttl=115 time=14.240 ms<br>64 bytes from 142.250.190.46: seq=1 ttl=115 time=13.820 ms<br>3 packets transmitted, 3 packets received, 0% packet loss</pre><h3>5. The Developer Experience: Interactive Shells &amp; Ergonomics</h3><p>One of the most important aspects was ensuring that Maclet feels as intuitive as Docker.</p><p>When you run:</p><pre>$ maclet exec web-1</pre><p>Maclet automatically launches an <strong>interactive shell session</strong>:</p><ul><li>Uses <strong>Rustyline</strong> for Up/Down arrow command history and line editing.</li><li>Tracks working directories (cd /etc updates the container&#39;s shell context).</li><li>Renders a clean container prompt:</li></ul><pre>Connected to web-1 (/bin/sh). Type &#39;exit&#39; to quit.<br>web-1:/ # uname -a<br>Linux maclet-cnt-17934218 6.6.134-0-virt #1-Alpine aarch64 Linux<br>web-1:/ # cd /etc<br>web-1:/etc # ls -d *<br>alpine-release  apk  hostname  hosts  os-release  resolv.conf ...<br>web-1:/etc # exit<br>Connection to web-test closed.</pre><p>And if you want to inspect or manage the virtual machine itself, you can drop directly into the micro-VM:</p><pre>$ maclet exec vm<br>Connected to maclet-vm (/bin/sh). Type &#39;exit&#39; to quit.<br>maclet-vm:/ #</pre><h3>6. How Maclet Compares to Docker Desktop</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrkyMnA0yyKYorVyI2mCbg.png" /></figure><h3>7. Key Takeaways from Building a Container Runtime</h3><ol><li><strong>Linux kernel primitives are surprisingly elegant</strong>: When you strip away the layers of Docker, containerd, and runc, Linux process isolation boils down to standard syscalls (clone, pivot_root, mount, and cgroup file I/O).</li><li><strong>Apple’s Virtualization Framework is fast</strong>: Bypassing QEMU in favor of VZVirtualMachine yields staggering performance gains on Apple Silicon.</li><li><strong>Rust is the ideal language for systems orchestration</strong>: The type system, ownership model, and zero-cost FFI allowed us to build an 11-crate modular architecture with rock-solid error handling.</li></ol><h3>Try It Out</h3><p>Maclet is completely open source under a permissive licence. You can clone, compile, and run it on any Apple Silicon Mac in minutes:</p><pre>git clone https://github.com/sumant1122/maclet.git<br>cd maclet<br>make release<br>make test<br><br># Start the runtime<br>./maclet machine init<br>./maclet machine start --daemon<br><br># Pull an image and run your first container<br>./maclet pull alpine:latest<br>./maclet run alpine:latest uname -a</pre><p><strong>Check out the source code and architecture on GitHub: </strong><a href="https://github.com/sumant1122/maclet">https://github.com/sumant1122/maclet</a></p><p><em>If you enjoyed this deep dive, feel free to give the repo a star on GitHub, share it on X/Twitter, or leave your thoughts in the comments!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=272ace2d9e50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building LiquidStats: A Floating Frosted-Glass System Monitor for macOS]]></title>
            <link>https://medium.com/@sumant1122/building-liquidstats-a-floating-frosted-glass-system-monitor-for-macos-8982c807f63d?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8982c807f63d</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 16:52:02 GMT</pubDate>
            <atom:updated>2026-10-14T16:52:02.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vNjljR8HwM3GjBB0fd6GKQ.png" /></figure><p>Every developer and power user has experienced this moment, where your Mac’s fans kick on, an editor stutter happens, and you’re forced to Cmd+Tab into <strong>Activity Monitor</strong> or squint at an overcrowded menu bar to figure out what just hijacked your CPU.</p><p>Over the years, dozens of third-party system monitoring apps have popped up to solve this. But almost all of them fall into one of two camps:</p><ol><li><strong>The Overweight Electron Utility:</strong> Consuming 300MB–600MB of RAM and 3% background CPU just to tell you how much RAM and CPU you have left.</li><li><strong>The Tiny Menu Bar Icon:</strong> Crammed into an already overflowing menu bar (especially on notched MacBooks), forcing you to click just to see anything meaningful.</li></ol><p>I wanted something different: a <strong>borderless, floating frosted-glass HUD</strong> that sits quietly in a corner of my desktop, always visible, gorgeous over any wallpaper, and built natively with <strong>near-zero CPU overhead</strong>.</p><p>That’s why I built <strong>LiquidStats</strong>.</p><h3>The Vision: Native Liquid Glass</h3><p>macOS has one of the most stunning design languages in desktop computing: deep vibrancy, smooth spring physics, and Apple’s signature .ultraThinMaterial frosted glass.</p><p>Instead of hiding metrics behind a menu bar click, LiquidStats is designed as an ambient, floating companion:</p><ul><li><strong>True Floating Level (</strong><strong>.floating):</strong> Floats cleanly above regular apps so you always have immediate visibility into system load.</li><li><strong>Liquid Frosted Glass:</strong> Built directly with SwiftUI’s native vibrancy materials that dynamically blur and tint based on whatever window or wallpaper is underneath.</li><li><strong>Multi-Desktop Awareness:</strong> Configured with .canJoinAllSpaces, so it glides with you across all your virtual spaces and full-screen apps without blinking.</li><li><strong>Draggable Anywhere:</strong> Click and drag from any part of the glass to park it wherever fits your workspace workflow.</li></ul><h3>Under the Hood: Zero-Overhead Kernel Diagnostics</h3><p>One strict rule guided the architecture: <strong>the monitor must never become the problem.</strong></p><p>Many monitoring tools cheat by repeatedly spawning shell processes like top, ps, or netstat in the background. While easy to write, spawning processes every second creates measurable context-switch overhead and drains battery life.</p><p>LiquidStats talks <strong>directly to the macOS Darwin Mach kernel via C-APIs</strong>:</p><h3>1. Direct CPU Sampling</h3><p>Instead of running top, we sample CPU ticks directly from the Mach host:</p><pre>host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, ...)</pre><p>By comparing user, system, and idle ticks across sampling intervals, we compute precise percentage utilization in microseconds with virtually 0% CPU impact.</p><h3>2. True macOS Memory Pressure</h3><p>On macOS, tracking “Free RAM” is fundamentally misleading. macOS aggressively caches files in inactive memory, meaning your Mac can show “90% Used RAM” while running completely happily.</p><p>The metric Apple actually uses in Activity Monitor is <strong>Memory Pressure</strong> (Normal, Warning, or Critical). LiquidStats reads this directly from kernel sysctl (kern.memorystatus_vm_pressure_level), surfacing a simple, color-coded status badge (🟢 Normal / 🟡 Warning / 🔴 Critical).</p><h3>3. Spotting the Culprits: Top 3 Heavy Apps</h3><p>Knowing your CPU is at 80% is only half the battle — you need to know <em>what</em> is causing it. Using Darwin’s libproc APIs (proc_listpids and proc_pidinfo), LiquidStats continuously identifies the top 3 resource-heavy applications (e.g., Xcode, Chrome, WindowServer) and renders them with proportional load bars.</p><h3>Dual Modes: Expanded vs. Compact Pill</h3><p>Not every workflow needs all metrics visible at once.</p><p>With one click (or via the right-click context menu), LiquidStats transitions smoothly into a <strong>Compact Mode</strong>:</p><ul><li><strong>Expanded Mode:</strong> Full circular radial gauges with glowing progress arcs, live CPU sparkline activity graph, top process bars, network download/upload rates, Wi-Fi RSSI, and battery telemetry.</li><li><strong>Compact Pill:</strong> An ultra-slim horizontal strip showing just the essentials (CPU %, RAM %, Net ↓, Battery). And if any background app suddenly spikes past 15% CPU, a mini flame alert badge pops up right inside the pill to notify you.</li></ul><p>The underlying borderless window dynamically resizes and animates, so clicking around the compact pill never intercepts clicks on your background windows.</p><p>You can clone it, build it, and run it in 5 seconds from your terminal:</p><pre>git clone https://github.com/sumant1122/liquid-stats.git<br>cd liquid-stats<br>make run</pre><p>The project is completely open source under the MIT License on GitHub:</p><p><a href="https://github.com/sumant1122/liquid-stats">GitHub - sumant1122/liquid-stats: A sleek, lightweight floating frosted-glass system monitor for macOS built with Swift and SwiftUI.</a></p><p>Feel free to star the repo, fork it, or open a PR if you’d like to add new metrics like GPU load or Bluetooth peripheral tracking!</p><p><em>If you liked this post, do clap and do leave a comment so I can create more interesting posts.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8982c807f63d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your CI is Too Slow: Enter JevCI’s Sub-Second AI Quality Gates]]></title>
            <link>https://medium.com/@sumant1122/your-ci-is-too-slow-enter-jevcis-sub-second-ai-quality-gates-392ce8205f68?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/392ce8205f68</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 14:06:13 GMT</pubDate>
            <atom:updated>2026-09-28T14:06:13.691Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gFruxByDuhsKuZPL" /><figcaption>Photo by <a href="https://unsplash.com/@imkaravisual?utm_source=medium&amp;utm_medium=referral">Imkara Visual</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><em>Why waiting 45 seconds for generative LLM code reviews is broken, and how non-autoregressive “System One” AI primitives solve it.</em></blockquote><h3>The Bottleneck in AI-Powered Code Reviews</h3><p>Large Language Models (LLMs) have revolutionized code generation and developer tooling. However, attempting to use bigger generative models as pre-commit hooks or strict CI/CD quality gates introduces a major bottleneck. Latency.</p><p>A standard autoregressive LLM evaluation takes anywhere from 30 to 60 seconds per pull request.</p><p>For developers, waiting nearly a minute for a pre-commit check or CI build breaks momentum. Furthermore, parsing long unstructured markdown responses from LLMs into programmatic pass/fail exit codes for CI pipelines is fragile and prone to hallucinations.</p><p>To make AI quality gates viable for real-time developer workflows, we need a fundamentally different architecture. A sub-second, deterministic, typed decision primitives.</p><p>That is why JevCI was built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZeqcH-h7zXtjpKKfZhaKkQ.png" /></figure><h3>System 1 vs. System 2 AI: A New Paradigm for Evals</h3><p>In <em>Thinking, Fast and Slow</em>, Daniel Kahneman describes two modes of thought:</p><ul><li>System 2 (Slow &amp; Deliberate): Complex, step-by-step reasoning. This maps to traditional generative LLMs generating text token-by-token.</li><li>System 1 (Fast &amp; Intuitive): Instantaneous, subconscious pattern recognition and classification.</li></ul><p>JevCI is built on Jev, the non-autoregressive “System One” foundational AI model developed by TypeSafe AI.</p><p>Rather than spending seconds generating conversational text, Jev processes an input state (git diff, commit message, repository documentation) and returns schema-constrained output scores and calibrated probability distributions in sub-200ms model inference time.</p><h3>Under the Hood: 4 Parallel Quality Lenses</h3><p>JevCI evaluates code changes across four core quality dimensions in a single parallel pass:</p><ol><li>Commit Message Quality (score primitive): Verifies that commit messages follow conventional standards (feat/fix/refactor) and clearly explain the motivation behind the change rather than vague descriptions like &quot;wip&quot; or &quot;fix bug&quot;.</li><li>Doc &amp; Code Alignment (score primitive): Scans git diffs against repository documentation (README.md) to ensure public interface changes or new parameter updates correspond to docs.</li><li>API Contract &amp; Breaking Risk (score primitive): Flags modified function signatures, deleted exports, or backwards-incompatible schema changes.</li><li>Secret &amp; Security Audit (noul boolean primitive): Audits diffs for exposed API keys, private credentials, or unsafe security patterns.</li></ol><p>Each dimension produces a numerical score 0–100 alongside a Jev Rating Confidence percentage, measuring how concentrated the model&#39;s probability distribution is around its evaluation.</p><h3>Zero-Latency Integration: CLI, Git Hooks, and GitHub Actions</h3><p>Because JevCI completes evaluation in sub-second total latency (including git extraction and network round-trip), it integrates seamlessly across the entire development lifecycle:</p><h3>1. Terminal CLI</h3><p>Run instant quality checks locally on your working tree or staged diffs:</p><pre>npx jevci --target staged --threshold 70</pre><h3>2. Git Pre-Commit Hooks</h3><p>Prevent low-quality commits or exposed credentials from ever entering your git history by adding JevCI to .git/hooks/pre-commit or Husky.</p><h3>3. GitHub Action &amp; Marketplace</h3><p>JevCI is published as an official GitHub Action. You can enforce quality gates on incoming Pull Requests and automatically post structured markdown feedback:</p><pre>- uses: sumant1122/jevci@v1.0.0<br>  with:<br>    threshold: &#39;70&#39;<br>  env:<br>    TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}</pre><h3>Getting Started &amp; Open Source</h3><ul><li>GitHub Marketplace: <a href="https://github.com/marketplace/actions/jevci-quality-gate">github.com/marketplace/actions/jevci-quality-gate</a></li><li>GitHub Repository: <a href="https://github.com/sumant1122/jevci">github.com/sumant1122/jevci</a></li></ul><p><em>Feedback, issues, and contributions are welcome from open-source developers building the future of fast developer tooling!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=392ce8205f68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Coding: The Case for Narrow AI Harnesses]]></title>
            <link>https://medium.com/@sumant1122/beyond-coding-the-case-for-narrow-ai-harnesses-dae8def8570f?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae8def8570f</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 10:44:27 GMT</pubDate>
            <atom:updated>2026-09-11T10:44:27.793Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XkkiCYyrb8z7BDyP" /><figcaption>Photo by <a href="https://unsplash.com/@mattseymour?utm_source=medium&amp;utm_medium=referral">Matt Seymour</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Harness engineering is an interesting field that has gained popularity recently. You might already be using a harness and probably don’t even realise it. Claude Code, Codex, OpenCode and numerous other coding tools are good examples of systems built around an agent harness.</p><h3><strong>Agent = Model + Harness</strong></h3><p>This equation serves as a simple way to understand harness engineering. Though there are plenty of complicated internal components that are implemented to make it professional grade, the basic idea remains the same.</p><h3><strong>So, what exactly is a harness?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gi5udBjIOSSP8RJj8XoBlg.jpeg" /></figure><p>At a very high level, a harness is everything that surrounds the model and enables it to perform a task reliably.</p><p>The model itself can reason, generate text, and decide what it wants to do. But it doesn’t inherently know which tools it can use, what context it should have, what actions it is allowed to take, or how to determine whether the task was actually completed successfully.</p><p>This is where the harness comes in and it can provide the model with:</p><p><strong>Context:</strong> the information it needs to understand the task</p><p><strong>Tools:</strong> the ability to interact with the environment</p><p><strong>State and memory:</strong> what has happened so far and what needs to be remembered</p><p><strong>Permissions and policies:</strong> what the agent is allowed to do</p><p><strong>Feedback:</strong> information about the result of an action</p><p><strong>Verification:</strong> a way to determine whether the intended outcome was actually achieved</p><p>This creates a continuous loop around the model.</p><p><strong>Observe → Reason → Act → Observe → Verify → Repeat</strong></p><p>The implementation can be much more complicated, but the underlying idea remains simple. The model observes the environment, takes an action, looks at the result, and continues the loop until the task is complete.</p><h3><strong>Take a coding agent as an example.</strong></h3><p>The model is not simply asked to generate some code and return it. The harness gives it access to a repository, terminal, tests, documentation, version control and other tools. The agent makes a change, runs a test, observes the result, identifies what went wrong, makes another change and runs the test again.</p><p>The feedback loop is what makes the system considerably more capable than simply asking an LLM to write code.</p><h3><strong>Thinking about harnesses differently</strong></h3><p>Does a harness have to be for coding? Most of the examples we see today are heavily focused on software development. Software development provides a very natural feedback loop.</p><p>The same principle can be applied to other domains. Asking the right questions leads to a plethora of new ideas that can be applied to practical everyday tasks and different domains. What if the environment given to the model was Kubernetes instead of a Git repository? What if its tools were logs, metrics, events and deployment history instead of a compiler and test suite?</p><p>This leads to an idea that I find particularly interesting.</p><h3><strong>Narrow Harness</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ah6BXa_YiqwmhlF7xhkSQw.jpeg" /></figure><p>Instead of building an increasingly general-purpose agent that can do everything, what if we build a harness around an agent that is designed to be focused on one particular job?</p><p>Imagine a harness whose entire environment is as follows:</p><p><strong>Kubernetes + Metrics + Logs + Events + Deployment History + Runbooks</strong></p><p>And its job is very simply to:</p><p><strong>Observe deployment → detect abnormality → investigate → diagnose → verify</strong></p><p>This is what I mean by a narrow harness. All the unnecessary tools, such as browsing the web, email access, managing calendars, etc., are removed from the tool set. Only the tools required for the job are made available to the agent. The agent is not becoming less capable. The environment is becoming more focused.</p><p>And this is where I think things start getting interesting.</p><h3><strong>Untapped opportunity</strong></h3><p>We have spent a lot of time making models more capable. We are also building increasingly general-purpose agents that can interact with more and more tools. What if, instead of making the agent more general, we make the environment around it more specialised?</p><p>A security harness could be built around SIEM, endpoint data and threat intelligence.</p><p>A research harness could be built around search, papers, documents and citation verification.</p><p>A finance harness could be built around transactions, accounting systems and financial rules.</p><p>A customer-support harness could be built around CRM, orders, policies and communication tools.</p><p>This makes me wonder if there is an opportunity to build an ecosystem of narrow harnesses, each designed around a specific real-world job. Instead of one agent that tries to do everything, perhaps we will have hundreds of specialised agents, each operating inside a harness designed specifically for what it needs to accomplish.</p><p><em>If you found this interesting, leave a comment and let me know what you think. I would love to hear your thoughts on narrow harnesses and where you see them being useful.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dae8def8570f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Wanted a Better Way to Process Event Data, So I Built a Data Engine in Rust]]></title>
            <link>https://medium.com/@sumant1122/i-wanted-a-better-way-to-process-event-data-so-i-built-a-data-engine-in-rust-5d9cc6a83cf7?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d9cc6a83cf7</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 09:14:42 GMT</pubDate>
            <atom:updated>2026-08-28T09:14:42.945Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RaBMsfZWJB1jbpmM" /><figcaption>Photo by <a href="https://unsplash.com/@dawson2406?utm_source=medium&amp;utm_medium=referral">Stephen Dawson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have spent enough time working with PySpark to become comfortable with DataFrames, schemas, transformations, shuffles, and the machinery behind distributed data processing.</p><p>But there was always one thing that bothered me.</p><p>You receive event data as JSON.</p><p>The JSON already has structure.</p><p>Yet before you can do much with it, you often end up describing that structure again.</p><pre>schema = StructType([<br>    StructField(&quot;event_id&quot;, StringType()),<br>    StructField(&quot;event_type&quot;, StringType()),<br>    StructField(&quot;timestamp&quot;, TimestampType()),<br>    ...<br>])</pre><pre>df = spark.read.schema(schema).json(...)</pre><p>It is perfectly reasonable from a data-engineering perspective. Explicit schemas give you predictability, type safety, and control.</p><p>But event data doesn’t always behave like a neatly designed database table.</p><p>A new field appears.</p><p>A nested object gains another property.</p><p>An integer becomes a floating-point value.</p><p>Different producers send slightly different versions of the same event.</p><p>And suddenly, maintaining the schema becomes part of the workload.</p><p><strong>I started wondering</strong>, <strong>what if the data engine could figure out the schema itself?</strong></p><p>That question eventually turned into Forge.</p><p>Forge is my experiment in building a distributed analytical data engine in Rust, designed around semi-structured event data, automatic schema inference, schema evolution, columnar execution, and distributed processing.</p><p>It is not intended to be Spark rewritten in Rust.</p><p>Instead, I wanted to explore a slightly different starting point:</p><blockquote><strong><em>What would a data engine look like if evolving event data were a first-class input rather than something we had to normalize before processing?</em></strong></blockquote><h3>Starting with messy events</h3><p>Imagine two batches of events.</p><p>The first batch looks like this:</p><pre>{&quot;event_id&quot;:1,&quot;user&quot;:{&quot;name&quot;:&quot;Alice&quot;,&quot;country&quot;:&quot;US&quot;},&quot;amount&quot;:120,&quot;status&quot;:&quot;COMPLETED&quot;}<br>{&quot;event_id&quot;:2,&quot;user&quot;:{&quot;name&quot;:&quot;Bob&quot;,&quot;country&quot;:&quot;UK&quot;},&quot;amount&quot;:85,&quot;status&quot;:&quot;FAILED&quot;}<br>{&quot;event_id&quot;:3,&quot;user&quot;:{&quot;name&quot;:&quot;Charlie&quot;,&quot;country&quot;:&quot;US&quot;},&quot;amount&quot;:340,&quot;status&quot;:&quot;COMPLETED&quot;}</pre><p>Then another batch arrives:</p><pre>{&quot;event_id&quot;:4,&quot;user&quot;:{&quot;name&quot;:&quot;Diana&quot;,&quot;country&quot;:&quot;US&quot;},&quot;amount&quot;:250.75,&quot;discount&quot;:15.5,&quot;tier&quot;:&quot;GOLD&quot;,&quot;status&quot;:&quot;COMPLETED&quot;}<br>{&quot;event_id&quot;:5,&quot;user&quot;:{&quot;name&quot;:&quot;Evan&quot;,&quot;country&quot;:&quot;FR&quot;},&quot;amount&quot;:99.99,&quot;discount&quot;:0.0,&quot;tier&quot;:&quot;SILVER&quot;,&quot;status&quot;:&quot;COMPLETED&quot;}</pre><p>Now we have several changes.</p><p>amount was an integer and is now a floating-point value.</p><p>discount didn&#39;t exist before.</p><p>tier didn&#39;t exist before.</p><p>And the useful fields are nested under user.</p><p>A traditional pipeline can certainly handle this.</p><p>But I wanted Forge to handle it naturally.</p><p>The ingestion command is simply:</p><pre>forge ingest -i demo/events_v1.ndjson -o demo/data/part-1.parquet<br>forge ingest -i demo/events_v2.ndjson -o demo/data/part-2.parquet</pre><p>There is nothing manually authored StructType.</p><p>No DDL.</p><p>The engine observes the incoming data, infers its structure, reconciles it with what it has already seen, and produces columnar data.</p><p>That became the first design principle of Forge:</p><blockquote><strong><em>Schema should be discovered from data by default, not manually reconstructed by the user.</em></strong></blockquote><h3>Schema inference is not the same as schema evolution</h3><p>At first, schema inference sounds easy.</p><p>Look at the JSON:</p><pre>{<br>  &quot;amount&quot;: 120<br>}</pre><p>and infer:</p><pre>amount: integer</pre><p>But then:</p><pre>{<br>  &quot;amount&quot;: 120.50<br>}</pre><p>What happens?</p><p>Or:</p><pre>{<br>  &quot;amount&quot;: 120,<br>  &quot;discount&quot;: 10<br>}</pre><p>when the previous batch didn’t contain discount at all?</p><p>This is where the problem becomes more interesting.</p><p>Forge separates schema discovery from schema evolution.</p><p>The schema layer contains an inference lattice, a schema registry, and a batch reconciler. The ingestion path can then reconcile incoming batches with the evolving dataset schema.</p><p>Conceptually:</p><pre>Incoming JSON<br>      │<br>      ▼<br>Type inference<br>      │<br>      ▼<br>Inferred schema<br>      │<br>      ▼<br>Schema reconciliation<br>      │<br>      ▼<br>Evolved dataset schema</pre><p>Instead of treating every change as an error, the engine can reason about how the new batch relates to what it already knows.</p><p>This sounds like a small feature.</p><p>It isn’t.</p><p>Once you allow schemas to evolve, you have to think about the following:</p><ul><li>type widening</li><li>missing fields</li><li>nullable fields</li><li>nested structures</li><li>conflicting types</li><li>field identity</li><li>compatibility between batches</li><li>how old data should be read using a newer schema</li></ul><p>The more I worked on this, the more I realized that <strong>schema evolution is a core part of the storage engine, not merely an ingestion convenience.</strong></p><h3>JSON is hierarchical. Analytics wants columns.</h3><p>There was another problem.</p><p>JSON is naturally hierarchical.</p><p>Consider:</p><pre>{<br>  &quot;user&quot;: {<br>    &quot;name&quot;: &quot;Alice&quot;,<br>    &quot;country&quot;: &quot;US&quot;<br>  }<br>}</pre><p>If we keep user as one giant object, analytical queries have to repeatedly navigate that structure.</p><p>But analytical engines work extremely well when useful values can be treated as columns.</p><p>So Forge uses sub-column shredding.</p><p>Conceptually:</p><pre>user<br> ├── name<br> └── country</pre><p>becomes:</p><pre>user.name<br>user.country</pre><p>This is important because it creates a bridge between two worlds:</p><pre>Semi-structured JSON<br>        │<br>        ▼<br>   Structured paths<br>        │<br>        ▼<br>      Columns<br>        │<br>        ▼<br>Columnar execution</pre><p>We haven’t thrown away the flexibility of JSON.</p><p>We’ve simply transformed it into a representation that an analytical engine can process efficiently.</p><h3>Why Arrow?</h3><p>Once I had the data represented as columns, the next question was:</p><p><strong>How should the engine represent those columns in memory?</strong></p><p>I didn’t want to invent another columnar memory format.</p><p>Apache Arrow already provides a well-defined columnar representation and an ecosystem around it.</p><p>So Forge uses Arrow RecordBatch as its in-memory processing representation.</p><p>The conceptual pipeline becomes:</p><pre>JSON<br>              │<br>              ▼<br>        Schema inference<br>              │<br>              ▼<br>       Column extraction<br>              │<br>              ▼<br>       Arrow RecordBatch<br>              │<br>              ▼<br>        Query execution</pre><p>This is also where the earlier decision about not making DataFrames the core abstraction became important.</p><p>A DataFrame is a useful user-facing interface.</p><p>But internally, what I really want is a collection of <strong>columnar batches flowing through an execution plan</strong>.</p><p>That distinction changes how you think about the system.</p><h3>And why Parquet?</h3><p>Arrow is excellent for processing data in memory.</p><p>It isn’t the storage format I wanted for persistent datasets.</p><p>For storage, Forge uses Parquet.</p><p>So the storage architecture is intentionally simple:</p><pre>Event data<br>                     │<br>                     ▼<br>                  JSON<br>                     │<br>              schema inference<br>                     │<br>                     ▼<br>              Arrow RecordBatch<br>                     │<br>                     ▼<br>                  Parquet<br>                     │<br>                     ▼<br>              EventDataset</pre><p>This gives the system a useful separation:</p><p><strong>JSON</strong> is an ingestion format.</p><p><strong>Arrow</strong> is an execution representation.</p><p><strong>Parquet</strong> is a persistent analytical format.</p><p>The storage layer can then read multiple partitions and reconcile their schemas when constructing a dataset.</p><h3>But then I started questioning DataFrames</h3><p>This was probably the most interesting conceptual shift for me.</p><p>When working with Spark, it is natural to think in terms of:</p><pre>DataFrame<br>   ↓<br>DataFrame<br>   ↓<br>DataFrame</pre><p>You filter a DataFrame.</p><p>Then group it.</p><p>Then aggregate it.</p><p>But the DataFrame itself isn’t really the computation.</p><p>The computation is the <strong>plan behind it</strong>.</p><p>For example:</p><pre>SELECT user_country,<br>       count(1),<br>       sum(amount)<br>FROM events<br>WHERE status = &#39;COMPLETED&#39;<br>GROUP BY user_country;</pre><p>What I really want the engine to understand is something like:</p><pre>Scan<br>                │<br>              Filter<br>                │<br>             GroupBy<br>                │<br>            Aggregate</pre><p>That is a logical plan.</p><p>The user-facing API could be SQL, a DataFrame-like API, or eventually something else.</p><p>The engine underneath doesn’t have to care.</p><p>This led to another principle:</p><blockquote><strong><em>The logical execution plan should be the core abstraction; the DataFrame should only be an interface to it.</em></strong></blockquote><h3>From SQL to an execution plan</h3><p>Forge currently has a SQL parser, logical planner, optimizer, and vectorized physical execution engine.</p><p>A query such as:</p><pre>SELECT user_country,<br>       count(1),<br>       sum(amount)<br>FROM events<br>WHERE status = &#39;COMPLETED&#39;<br>GROUP BY user_country;</pre><p>can conceptually become:</p><pre>Scan(events)<br>      │<br>      ▼<br>Filter(status = &#39;COMPLETED&#39;)<br>      │<br>      ▼<br>GroupBy(user_country)<br>      │<br>      ▼<br>HashAggregate(count, sum)</pre><p>The optimizer can then reason about how this should actually be executed.</p><p>For example:</p><pre>Read only required columns<br>        ↓<br>Filter early<br>        ↓<br>Aggregate locally<br>        ↓<br>Shuffle<br>        ↓<br>Final aggregation</pre><p>This matters enormously once the data becomes large.</p><p>If a worker can reduce 100 GB of input to 2 GB before sending anything across the network, that is not a small optimization.</p><p>It is a fundamentally different workload.</p><h3>Vectorized execution</h3><p>This is another reason the columnar representation matters.</p><p>Instead of thinking:</p><pre>row<br> ↓<br>process<br> ↓<br>row<br> ↓<br>process<br> ↓<br>row</pre><p>the engine works with batches:</p><pre>Arrow RecordBatch<br>        │<br>        ├── column A<br>        ├── column B<br>        ├── column C<br>        └── column D</pre><p>Operations can then be applied over arrays of values.</p><p>For example:</p><pre>amount:<br>[120, 85, 340, 250.75, 99.99]</pre><pre>filter:<br>amount &gt; 100</pre><pre>result:<br>[true, false, true, true, false]</pre><p>This is a much better match for modern CPUs than repeatedly navigating individual objects.</p><p>Forge’s query layer currently includes vectorized filtering and hash aggregation.</p><p>And this is where several seemingly unrelated decisions start fitting together:</p><pre>JSON<br> │<br> ├── schema inference<br> │<br> ├── nested field extraction<br> │<br> ▼<br>Arrow columns<br> │<br> ▼<br>vectorized execution<br> │<br> ▼<br>analytical queries</pre><h3>Then distributed execution enters the picture</h3><p>Everything above can happen on a single machine.</p><p>But the original inspiration came partly from Spark, so eventually the engine has to distribute work.</p><p>The architecture starts looking like:</p><pre>Driver<br>                       │<br>                 Logical Plan<br>                       │<br>                 Physical Plan<br>                       │<br>          ┌────────────┼────────────┐<br>          ▼            ▼            ▼<br>       Worker 1     Worker 2     Worker 3<br>          │            │            │<br>          └────────────┼────────────┘<br>                       │<br>                     Shuffle</pre><p>This is where distributed systems stop being theoretical.</p><p>You suddenly have to care about:</p><ul><li>partitioning</li><li>task scheduling</li><li>network transport</li><li>serialization</li><li>backpressure</li><li>worker failures</li><li>retries</li><li>skew</li><li>intermediate data</li><li>memory pressure</li></ul><p>Forge currently experiments with this using Apache Arrow Flight as the RPC layer for distributed shuffle, along with a stage scheduler and streaming client.</p><p>The idea is simple:</p><blockquote><em>Keep the data in Arrow’s columnar representation as it moves between stages, instead of repeatedly converting it into application-specific formats.</em></blockquote><h3>Why Rust?</h3><p>The choice of Rust was deliberate.</p><p>A project like this sits close to several things Rust is particularly good at:</p><pre>Memory management<br>      +<br>Concurrency<br>      +<br>Networking<br>      +<br>Parallel execution<br>      +<br>Systems programming</pre><p>But Rust also forces you to confront things that are easy to abstract away in higher-level languages.</p><p>Where does this data live?</p><p>Who owns it?</p><p>When can it be moved?</p><p>Can two workers safely access it?</p><p>When does a buffer get released?</p><p>What does concurrency mean for this particular data structure?</p><p>Those questions are not incidental in a data engine.</p><p>They are the engine.</p><p>And that is one of the reasons building Forge has been interesting for me.</p><p>I didn’t just want to learn Rust syntax.</p><p>I wanted to use Rust to think about <strong>data movement, concurrency, memory, and distributed execution</strong>.</p><h3>Forge today</h3><p>The project is still an experiment, but the pieces are starting to form a coherent system.</p><p>The current workspace is split into several components:</p><pre>forge-core<br>    Common types and field identifiers</pre><pre>forge-schema<br>    Type inference<br>    Schema evolution<br>    Batch reconciliation</pre><pre>forge-ingest<br>    NDJSON parsing<br>    Arrow RecordBatch creation<br>    Sub-column shredding</pre><pre>forge-storage<br>    Parquet<br>    Dataset management<br>    Schema reconciliation</pre><pre>forge-query<br>    SQL parser<br>    Logical planner<br>    Optimizer<br>    Vectorized execution<br>    Hash aggregation</pre><pre>forge-flight<br>    Distributed scheduling<br>    Arrow Flight shuffle</pre><pre>forge-cli<br>    Command-line interface</pre><p>That separation is intentional.</p><p>I want the system to remain understandable as it grows instead of turning into one large distributed application.</p><h3>A complete example</h3><p>The current demo is intentionally small.</p><p>First, ingest two batches that don’t have exactly the same schema:</p><pre>forge ingest \<br>  -i demo/events_v1.ndjson \<br>  -o demo/data/part-1.parquet</pre><pre>forge ingest \<br>  -i demo/events_v2.ndjson \<br>  -o demo/data/part-2.parquet</pre><p>Then query them:</p><pre>forge query \<br>  -d demo/data \<br>  -s &quot;SELECT event_id, user_name, user_country,<br>             amount, discount, tier, status<br>      FROM events&quot;</pre><p>The resulting dataset contains fields that were introduced only in the second batch, without requiring the user to manually rebuild the schema.</p><p>And we can perform an analytical query:</p><pre>SELECT user_country,<br>       count(1),<br>       sum(amount)<br>FROM events<br>WHERE status = &#39;COMPLETED&#39;<br>GROUP BY user_country;</pre><p>Which produces:</p><pre>user_country    count    sum(amount)<br>------------------------------------<br>FR              1        99.99<br>US              3        710.75</pre><p>It’s a tiny example.</p><p>But it demonstrates the complete idea:</p><pre>Messy JSON<br>    ↓<br>Schema inference<br>    ↓<br>Schema evolution<br>    ↓<br>Nested field extraction<br>    ↓<br>Arrow<br>    ↓<br>Parquet<br>    ↓<br>SQL<br>    ↓<br>Logical plan<br>    ↓<br>Optimization<br>    ↓<br>Vectorized execution</pre><p>And eventually:</p><pre>↓<br>Distributed execution<br>    ↓<br>Shuffle<br>    ↓<br>Workers</pre><h3>What’s next?</h3><p>Forge is nowhere near being a replacement for Spark, and that isn’t the goal.</p><p>There are already excellent systems solving distributed analytics at enormous scale.</p><p>The goal here is exploration.</p><p>There are still several areas I want to take further:</p><pre>Distributed execution<br>        ↓<br>Fault tolerance<br>        ↓<br>Object storage<br>        ↓<br>Kubernetes<br>        ↓<br>Observability<br>        ↓<br>Production workloads</pre><p>The roadmap currently includes a Kubernetes operator, S3/GCS object storage, and OpenTelemetry tracing.</p><p>I am particularly interested in the operational side.</p><p>A distributed engine isn’t useful simply because it can execute a query.</p><p><strong>Why build another data engine?</strong></p><p>That’s probably the obvious question.</p><p>There are already Spark, Flink, DuckDB, DataFusion, Polars, ClickHouse, and many other excellent systems.</p><p>Forge isn’t an attempt to beat them.</p><p>It started with a question I couldn’t quite let go of:</p><p><strong>Why does semi-structured event data have to become a rigid schema before it becomes easy to analyze?</strong></p><p>Building the answer myself has forced me to understand things I previously experienced mostly through an API:</p><p>schemas, columnar memory, query planning, optimization, vectorization, shuffles, scheduling, networking, and failure.</p><p>That has made the project worthwhile even before it becomes anything resembling a production system.</p><p>Maybe Forge will eventually become a useful engine.</p><p>Maybe it will remain a learning project.</p><p>Either way, the experiment has already done something valuable:</p><p>It made me stop thinking about Spark as a DataFrame API and start thinking about what is actually happening underneath it.</p><p>And that is what I wanted to build.</p><p><strong>Not Spark in Rust. Something different.</strong></p><p><strong>Check out Forge on GitHub:</strong></p><p><a href="https://github.com/sumant1122/forge">GitHub - sumant1122/forge: Distributed analytical engine in Rust for semi-structured event data with automatic schema inference, evolution, Apache Arrow &amp; Parquet.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d9cc6a83cf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Thread-Per-Core Asynchronous Message Broker in Rust Using io_uring]]></title>
            <link>https://medium.com/@sumant1122/building-a-thread-per-core-asynchronous-message-broker-in-rust-using-io-uring-c36164abeb2f?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c36164abeb2f</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Fri, 22 May 2026 12:20:44 GMT</pubDate>
            <atom:updated>2026-05-22T12:20:44.695Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e9YfInoG26YijLOU" /><figcaption>Photo by <a href="https://unsplash.com/@sebastiansvenson?utm_source=medium&amp;utm_medium=referral">Sebastian Svenson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of high-throughput infrastructure, Apache Kafka has long stood as the gold standard for distributed commit logs. However, traditional architectures face inherent limits, kernel-space transitions, thread context-switch overhead, and lock contention.</p><p>To explore what modern Linux features can achieve, I built RingLog, a highly-optimized, single-node, thread-per-core message broker from scratch in Rust. RingLog achieves zero-copy characteristics and lock-free execution by combining Rust’s type safety with io_uring. “io_uring” is the state-of-the-art asynchronous system call interface for Linux.</p><p>Here is a deep dive into the design decisions, architecture, and Rust implementation details of RingLog.</p><h3>The Paradigm Shift: Thread-Per-Core &amp; io_uring</h3><p>Traditional networked applications handle concurrency by spawning a thread pool or using multi-threaded event loops (e.g., standard Tokio or Netty).</p><p>While robust, this model introduces distinct overheads:<br>1. <strong>Context Switches:</strong> Shuttling execution contexts between CPU cores degrades cache locality.<br>2. <strong>Synchronization Locks:</strong> Sharing state (like a commit log) across threads requires mutexes or atomic locks, leading to thread contention.<br>3. <strong>Syscall Overhead:</strong> Standard synchronous read/write calls involve transitions from user-space to kernel-space and back.</p><h3>The Solution</h3><p><strong>Thread-Per-Core:</strong> By anchoring our entire broker and its connection loop onto a single thread pinned to a single CPU core, we completely eliminate multi-threaded coordination.<br><strong>io_uring:</strong> Introduced by Jens Axboe in Linux 5.1, “io_uring” uses two ring buffers, a <strong>Submission Queue (SQ)</strong> and a <strong>Completion Queue (CQ)</strong> that are shared directly between user-space and kernel-space. RingLog can submit both file write/read and socket send/recv operations to the kernel asynchronously without incurring individual blocking syscall context switches.</p><h3>RingLog Architecture &amp; Wire Protocol</h3><p>RingLog implements a highly optimized, lean Kafka-style broker pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*VedjkYn595E_CPtNZVK3fA.png" /></figure><h3>The Binary Protocol</h3><p>Communication occurs over TCP using a raw binary framing format to eliminate parsing overhead:<br>1. <strong>Handshake:</strong> Upon connection, the client sends a single byte designating its role: “0x01” for Producer, “0x02” for Consumer.<br>2. <strong>Producer Flow:</strong> Streams records structured as “[4-Byte Big-Endian Length] [Payload]”. The server appends this to the WAL and responds with an “[8-Byte Big-Endian Physical Offset]” ACK.<br>3. <strong>Consumer Flow:</strong> Sends an “[8-Byte Big-Endian Starting Offset]”. The server streams back records sequentially. If the consumer reaches the current end of the log, it yields and awaits real-time notifications of new writes.</p><h3>Deep Dive: The Rust Implementation</h3><p>Let’s dissect two of the most critical implementation challenges and how Rust’s unique design resolved them.</p><p><strong>1. Thread-Local Event Loops &amp; `std::rc::Rc`</strong></p><p>During implementation, we initially wrapped our shared storage engine in `std::sync::Arc&lt;tokio::sync::Mutex&lt;UringCommitLog&gt;&gt;`. However, `tokio_uring` structures, such as `tokio_uring::fs::File`, represent raw Linux file descriptors managed on a thread-local event loop. Because they do not implement `Send` or `Sync`, wrapping them in `Arc` triggered strict compiler errors and clippy warnings (`clippy::arc_with_non-send-sync`).</p><p>Since the event loop runs on a single thread inside `tokio_uring::start`, we swapped `Arc` for **`std::rc::Rc`** (Reference Counting). This choice fits the thread-local architecture perfectly:</p><pre>// In src/main.rs - Creating and sharing the log handle across connection tasks<br>let log = Rc::new(Mutex::new(UringCommitLog::open(log_path).await?));<br><br>let server_log = Rc::clone(&amp;log);<br>tokio_uring::spawn(async move {<br>    loop {<br>        if let Ok((stream, _)) = listener.accept().await {<br>            let log_clone = Rc::clone(&amp;server_log);<br>            tokio_uring::spawn(async move {<br>                handle_connection(stream, log_clone, ...).await<br>            });<br>        }<br>    }<br>});</pre><p>This guarantees complete type-safety while completely avoiding atomic reference-counting overhead!</p><p><strong>2. Zero-Copy via Ownership Transfer</strong></p><p>When issuing I/O operations through `io_uring`, the kernel reads/writes memory directly via DMA. If the buffer is modified or dropped in user-space before the kernel completes the transfer, memory corruption occurs.</p><p>To prevent this, `tokio-uring` requires transferring complete ownership of the buffers to the kernel. We implement this for TCP streaming using <strong>Buffer Slicing.</strong></p><pre>async fn write_all(stream: &amp;TcpStream, mut buf: Vec&lt;u8&gt;) -&gt; io::Result&lt;Vec&lt;u8&gt;&gt; {<br>    let mut written = 0;<br>    let len = buf.len();<br>    while written &lt; len {<br>        // Take a slice owning the buffer, transfer to kernel, and retrieve the buffer back<br>        let slice = buf.slice(written..len);<br>        let (res, slice) = stream.write(slice).await;<br>        let n = res?;<br>        if n == 0 {<br>            return Err(io::Error::new(io::ErrorKind::WriteZero, &quot;failed to write entire buffer&quot;));<br>        }<br>        buf = slice.into_inner(); // Recover ownership of original Vec&lt;u8&gt;<br>        written += n;<br>    }<br>    Ok(buf)<br>}</pre><p>Using `.slice(range)` creates an owned wrapper representing the subset of the vector to be transferred. Once the kernel acknowledges the write, we retrieve the original vector via `.into_inner()`, achieving zero allocations in the hot path.</p><h3>Real-Time Coordination Without Contention</h3><p>How does a consumer tail the log in real-time without busy-waiting or thread-contention? RingLog leverages a cooperative watch channel.</p><pre>// Consumer client loop tailing the WAL<br>let mut current_offset = start_offset;<br>loop {<br>    let write_offset = {<br>        let log_guard = log.lock().await;<br>        log_guard.write_offset<br>    };<br><br>    if current_offset &lt; write_offset {<br>        // Read historical data from WAL and stream it<br>        let (payload, next_offset) = log.lock().await.read_at(current_offset).await?;<br>        write_all(&amp;stream, payload).await?;<br>        current_offset = next_offset;<br>    } else {<br>        // We reached the end of the log; await real-time notification<br>        let mut rx = waker_rx.clone();<br>        if *rx.borrow() &lt;= current_offset {<br>            // Await waker waken by producer appends<br>            let _ = rx.changed().await;<br>        }<br>    }<br>}</pre><p>When a producer appends a message, it calls `waker_tx.send(new_offset)`. Waiting consumer tasks on the same event loop wake up instantly, access the commit log asynchronously, and stream the new bytes to the network.</p><h3>Conclusion &amp; Key Takeaways</h3><p>Building RingLog proved that the <strong>thread-per-core</strong> architecture paired with <strong>io_uring</strong> offers an exceptionally clean paradigm for building low-latency, high-throughput systems:<strong><br>1. Lock-Free Concurrency:</strong> Restricting mutable state to a single thread lets us write extremely fast async code using inexpensive `std::rc::Rc` structures rather than heavy synchronization primitives.<br><strong>2. Efficient I/O:</strong> Offloading socket and file system writes directly to `io_uring` ring buffers minimizes user-kernel boundaries.<br><strong>3. Safety Built-in:</strong> Rust’s compiler ensures that memory buffer ownership is strictly tracked, making zero-copy network architectures completely safe from data races.</p><p>If you are interested in modern Linux systems programming or low-latency systems in Rust, check out the full source code and contribute!</p><p>GitHub Repository: <a href="https://github.com/sumant1122/ringlog">https://github.com/sumant1122/ringlog</a></p><p><em>Have you experimented with io_uring or thread-per-core designs in your projects? Let me know your thoughts in the comments below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c36164abeb2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Package You Didn’t Write Just Backdoored Your App]]></title>
            <link>https://medium.com/@sumant1122/the-package-you-didnt-write-just-backdoored-your-app-000b9a6197e1?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/000b9a6197e1</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Fri, 15 May 2026 11:03:29 GMT</pubDate>
            <atom:updated>2026-05-15T11:03:29.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LeTy45IB8zVboTYl" /><figcaption>Photo by <a href="https://unsplash.com/@craft_ear?utm_source=medium&amp;utm_medium=referral">Jan Tinneberg</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><em>Supply chain attacks have reached a new level of sophistication. Here’s how they work and how an open-source tool called Vigil helps you fight back.</em></p><p>The code you write is only a fraction of the code that runs in your application. The rest of the towering stack of packages, libraries, and transitive dependencies you’ve imported belongs to someone else. And increasingly, that someone is being targeted by attackers who understand that compromising a single widely used package is worth far more than attacking a thousand individual applications.</p><p>This is the software supply chain attack. And in the last year, it stopped being a theoretical concern.</p><h3>2025–2026: The Year the Supply Chain Became a Warzone</h3><p><strong>September 2025: The Chalk/Debug Attack</strong></p><p>It started with a phishing email. A threat actor impersonated npm support and sent a convincing message to Josh Junon, the maintainer of foundational packages like chalk and debug. The fake domain (support@npmjs.help) had a valid SSL certificate. The email, likely AI-generated, perfectly mimicked official npm correspondence and created artificial urgency around a &quot;2FA credential update.&quot; The maintainer handed over his credentials and OTP.</p><p>Within hours, the attackers had published malicious versions of 18 npm packages. Packages with a combined weekly download count exceeding <strong>2.6 billion</strong>. The injected payload was a crypto-stealer that hooked into browser wallet APIs and silently redirected cryptocurrency transactions. The malicious versions were live for roughly two hours before detection and removal. In that window, any developer who ran npm install had their environment touched by attacker-controlled code.</p><p><strong>September 2025: The Shai-Hulud Worm</strong></p><p>If the chalk/debug attack was a sniper shot, what came next was a self-replicating missile. Dubbed Shai-Hulud after the sandworms in <em>Dune</em>, this was the <strong>first self-propagating worm in the npm ecosystem</strong>, ultimately infecting over 500 packages.</p><p>The mechanics were chilling. Once it gained an npm token, it automatically published malicious versions of every package that token had access to. It integrated the legitimate secret-scanning tool TruffleHog to harvest credentials from victim environments. It probed AWS, GCP, and Azure metadata endpoints for ephemeral cloud credentials. It created GitHub repositories to exfiltrate stolen secrets. It was autonomous, fast, and exponential.</p><p><strong>March 2026: The axios Compromise</strong></p><p>The axios attack demonstrated that state-sponsored actors were now playing in this space. Researchers attributed the attack to UNC1069, a financially motivated North Korean threat actor. The attacker approached axios maintainer Jason Saayman through an elaborate social engineering campaign. A fake company outreach, a convincingly branded Slack workspace, a Microsoft Teams call with what appeared to be an entire team of colleagues, and finally, a prompt to install something to “fix” a technical issue. The payload was a Remote Access Trojan capable of system reconnaissance, credential harvesting, and remote command execution.</p><p><strong>May 2026: The TanStack Attack and node-ipc</strong></p><p>Just days ago, as of this writing, two more major incidents hit the ecosystem.</p><p>The TanStack attack compromised 42 @tanstack/* packages through a sophisticated GitHub Actions cache poisoning exploit, publishing 84 malicious versions. The attack used an OIDC token extraction technique that read directly from the GitHub Actions runner process memory, bypassing the standard publish workflow entirely. External researchers detected it within 20 minutes. The malicious versions had already been pushed.</p><p>Meanwhile, three compromised versions of node-ipc, a foundational Node.js package with over 10 million weekly downloads , were simultaneously published by what appears to be a hijacked maintainer account. Each version carries an identical 80KB obfuscated credential-stealing payload targeting cloud credentials, SSH keys, and CI/CD secrets.</p><h3>Why This Keeps Happening</h3><p>The pattern is clear, and it exploits a structural weakness in how open-source ecosystems are built.</p><p><strong>The trust problem.</strong> When you run npm install, you&#39;re not just installing the package you asked for. You&#39;re trusting every dependency of that package, and every dependency of those dependencies. The attack surface isn&#39;t the code you can see; it&#39;s the code three levels down that nobody&#39;s looking at.</p><p><strong>The maintainer problem.</strong> The most critical packages in the world are often maintained by one or two individuals. The chalk package, used by hundreds of thousands of projects, was compromised through a single phishing email sent to a single human being. The bus factor is 1, and attackers know it.</p><p><strong>The “no CVEs = safe” fallacy.</strong> The security tooling most teams use checks for known CVEs. That’s table stakes. But a package with zero CVEs can still be:</p><ul><li>Abandoned for three years by a maintainer who no longer has time to respond to issues</li><li>Maintained by a single developer who is one social engineering attempt away from being compromised</li><li>Dragging in dozens of transitive dependencies that nobody has audited</li><li>Licensed in a way that creates legal liability for your organization</li></ul><p>CVE scanners tell you about the <em>past</em>. Supply chain security is about the <em>future</em>.</p><h3>Introducing Vigil: Auditing for the Future</h3><p>This is the problem that <strong>Vigil</strong> is built to solve. Vigil is an open-source, zero-configuration terminal dashboard that treats your dependency tree as a living organism to be monitored — not just scanned.</p><p>You navigate to your project root and run a single command:</p><pre>vigil</pre><p>That’s it. Vigil auto-detects your ecosystem, whether you’re working in <strong>Rust</strong>, <strong>Node.js</strong>, <strong>Python</strong>, or <strong>Go,</strong> and brings up an interactive dual-pane dashboard.</p><h3>What Vigil Actually Measures</h3><p><strong>Security (via OSV.dev).</strong> Vigil integrates with the Open Source Vulnerabilities database. Critically, it uses a single batched API call for your <em>entire</em> dependency tree, so there’s no rate-limiting or per-package delay. Known vulnerabilities immediately push a package’s score toward red.</p><p><strong>Staleness.</strong> This is where Vigil goes beyond traditional scanners. It pulls live data from crates.io and the npm registry to measure when a package was last updated. A package that hasn’t been touched in two years gets a significantly lower vitality score, even if it has no CVEs. This is the signal that tells you a package might be a soft target for an attacker who registers a similar-looking name or compromises a dormant account.</p><p><strong>Bloat Index.</strong> Vigil calculates your transitive dependency graph and shows you not just how many packages you <em>declared</em>, but how many packages actually come along for the ride. The chalk/debug attack would have been visible here, dozens of seemingly unrelated packages were implicitly trusting a single maintainer account.</p><p><strong>License Tracking.</strong> Every dependency’s license is surfaced in the dashboard, letting you catch GPL contamination or other legal issues before they become your legal team’s problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*TtUxr3w5EXMY9yuQBU6Umg.png" /></figure><h3>The Dashboard</h3><p>The left pane is an inventory of every dependency, sorted by risk (lowest score first, so the most dangerous dependencies are at the top). Each row shows the name, version, and a color-coded composite score:</p><ul><li><strong>Green (80–100):</strong> Healthy, active, secure.</li><li><strong>Yellow (50–79):</strong> Worth watching. Possibly stale or lightly maintained.</li><li><strong>Red (0–49):</strong> Requires immediate attention, active CVEs, or an abandoned project.</li></ul><p>The right pane gives you the full drill-down, security status, maintenance signals, dependency counts, and license information. Navigate with arrow keys, quit with q.</p><h3>Built for Speed</h3><p>Vigil uses a persistent local cache at ~/.cache/vigil. After the first run, subsequent runs are near-instant, data is only re-fetched when it&#39;s more than 24 hours stale. For large dependency trees, concurrent fetching ensures the initial scan is fast too.</p><h3>The Bigger Picture</h3><p>None of the attacks described above were stopped by npm audit. Chalk and debug had no CVEs when the attack began. Axios had no CVEs. The malicious node-ipc versions were brand new, and there was no CVE to match against.</p><p>What <em>would</em> have helped is knowing:</p><ul><li>“This package is maintained by a single person. It’s a concentrated trust point.”</li><li>“This package hasn’t been updated in 18 months. It might be a soft target.”</li><li>“I have 312 transitive dependencies. I only declared 47.”</li></ul><p>This is the kind of situational awareness Vigil is designed to give you. It won’t prevent a compromised maintainer from publishing malicious code. Nothing will. But it gives you the context to ask better questions: <em>Do I need this dependency? Is there a more actively maintained alternative? Am I comfortable with this many hidden packages in my build pipeline?</em></p><h3>Getting Started</h3><p>Vigil is open source, MIT licensed, and built in Rust for maximum performance. Install it from source:</p><pre>git clone https://github.com/sumant1122/vigil.git<br>cd vigil<br>cargo install --path .</pre><p>Then just run vigil in any project directory.</p><h3>Conclusion</h3><p>The npm supply chain attack wave of 2025–2026 has permanently changed the calculus of open-source security. “Zero vulnerabilities” is no longer the finish line, it’s the starting line. The real question is whether the people maintaining your dependencies are safe, active, and invested.</p><p>Vigil exists because your dependency tree is a living thing that needs to be monitored, not just audited once and forgotten. In a world where a single phishing email can compromise a package with 2.6 billion weekly downloads, the only rational response is continuous visibility.</p><p>The supply chain is the new attack surface. It’s time to start watching it.</p><p><em>Vigil is open source and available at: </em><a href="https://github.com/sumant1122/vigil">https://github.com/sumant1122/vigil</a><br><em>Contributions and feedback welcome.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=000b9a6197e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bottleneck in Software Development Isn’t Writing Code. It’s Understanding It.]]></title>
            <link>https://medium.com/@sumant1122/the-bottleneck-in-software-development-isnt-writing-code-it-s-understanding-it-a469de5e8921?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a469de5e8921</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Mon, 11 May 2026 18:15:22 GMT</pubDate>
            <atom:updated>2026-05-11T18:15:22.193Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_QmyEM50RX_RR-w3" /><figcaption>Photo by <a href="https://unsplash.com/@kaleidico?utm_source=medium&amp;utm_medium=referral">Kaleidico</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I once spent two hours staring at a single error message: error -8.</p><p>No stack trace. No file name. No line number. Just a number, a kernel panic, and a system that wouldn’t boot. I was setting up a Linux kernel development environment, compiling the kernel from source, booting it inside QEMU, trying to load a simple module I’d written in Rust. Everything I thought I’d configured correctly. Everything the tutorials said to do.</p><p>The fix, when I finally found it, was a single line: scripts/config --enable CONFIG_64BIT.</p><p>My kernel was compiling as 32-bit. The busybox binary it was trying to run was 64-bit. The kernel literally did not know how to execute the program and instead of telling me that clearly, it handed me a number.</p><p>Two hours. One config flag.</p><p>What I learned that day had nothing to do with kernel development. It was something I’d been quietly missing for years of writing application code: <strong>I had optimized for writing. I had never learned to understand.</strong></p><h3>We’ve Built a Culture Around Output</h3><p>The last twenty years of software development have been almost entirely focused on reducing the friction of producing code.</p><p>Better editors. Smarter autocomplete. Faster frameworks. Higher-level abstractions. Stack Overflow. GitHub Copilot. ChatGPT. Each generation of tooling making it easier, faster, and cheaper to go from idea to running code.</p><p>And it worked. A solo developer today can ship what took a team of ten in 2005. The productivity gains are real and genuinely impressive.</p><p>But something got left behind.</p><p>While we were optimizing for output, we quietly stopped investing in comprehension, the ability to look at a system you didn’t build, understand what it’s actually doing, and make a correct judgment about why it behaves the way it does.</p><p>We can write faster than ever. We understand less than we think.</p><h3>What “Optimized for Writing” Looks Like</h3><p>It doesn’t look like incompetence. It looks like normal, everyday development.</p><p>It’s the developer who copies a Stack Overflow answer, tweaks it until the tests pass, and ships it without being able to explain why it works. It’s the team that reaches for a caching layer before they’ve understood their query patterns. It’s the engineer who has been using a library for two years and only discovers, during a production incident, that there’s a default timeout they never knew existed.</p><p>It’s also subtler than that. It’s the habit of reaching for a new abstraction before exhausting the one you’re already using. It’s treating error messages as obstacles to click past rather than information to read. It’s the reflex of googling the symptom instead of reasoning about the cause.</p><p>None of these are moral failures. They’re rational responses to a culture that rewards shipping and penalizes slowness. When the incentive is output, you optimize for output. The comprehension work is slow, often invisible, hard to measure, and getsskipped.</p><p>Until it doesn’t.</p><h3>The Abstraction Debt Nobody Talks About</h3><p>Every layer of abstraction is a loan.</p><p>It gives you speed now and charges interest later in debugging time, in performance surprises, in systems that become impossible to reason about as they grow. We talk endlessly about technical debt. We almost never talk about <em>abstraction debt, </em>the accumulated cost of building on layers you don’t understand.</p><p>The interest shows up in specific ways.</p><p>You can’t predict how your system behaves under load because you don’t know what the framework is doing under the hood. You can’t diagnose a production incident quickly because the error is three layers below the code you wrote. You add a library to solve a problem and introduce two new problems you won’t discover for six months.</p><p>Application development insulates you from this for a long time. The abstractions are deep and well-maintained. The frameworks handle the messy parts. Most of the time, you don’t need to know what’s underneath.</p><p>But “most of the time” is not “always.” And the gap between developers who can go one level deeper when it matters and those who can’t is enormous in the quality of their diagnoses, in the robustness of their designs, and in the speed at which they debug things that have never been debugged before.</p><h3>The Environment Where None of This Is Optional</h3><p>This is why I keep coming back to what I learned from that kernel setup experience.</p><p>The Linux kernel is the one environment where the abstractions that application developers rely on simply don’t exist. There’s no framework to handle the messy parts. There’s no runtime to catch your mistakes. There’s no garbage collector, no helpful error messages, no process isolation. If something goes wrong, the whole system goes down.</p><p>In that environment, you cannot optimize for writing. You are <em>forced</em> to understand.</p><p>Before you can enable a feature, you have to understand how the kernel’s configuration system works, the tree of Kconfig files, the dependencies between options, and the fact that a missing option doesn’t throw an error, it just silently hides the thing you’re looking for. Before you can load a module, you have to understand how the build system produces .ko files, why there are two separate passes, what modpost is doing, and why it matters.</p><p>You can’t skip any of this. You can’t abstract it away. Every layer has to be understood before you can use it.</p><p>And the strange thing is, once you’ve spent time in that environment, you can’t un-see it. You go back to writing application code, and you start asking questions you didn’t know to ask before. <em>What is this framework actually doing here? What happens when this fails? Why does this abstraction exist? What problem is it hiding from me?</em></p><h3>The Habit That Actually Transfers</h3><p>I’m not arguing that everyone should write kernel code. That’s a niche skill with limited direct applicability.</p><p>I’m arguing for a specific habit, applicable at any level of the stack: <strong>when something surprises you, go one level deeper than you normally would.</strong></p><p>Not always. Not as a religion. You don’t need to understand the kernel to build a great web app. But when the bug doesn’t make sense, when the performance profile is unexpected, when the error message doesn’t match your mental model, that’s the moment to resist the reflex of googling the symptom and instead ask: <em>what is this system actually doing?</em></p><p>That question, asked consistently, builds a kind of understanding that doesn’t come from writing more code. It comes from reading systems you didn’t build. From sitting with an error message longer than is comfortable. From following a chain of causation past the point where it would have been easier to just try a different fix.</p><h3>Why This Matters More Now</h3><p>Here’s the uncomfortable truth about AI-assisted development, it’s about to dramatically accelerate the problem.</p><p>AI is excellent at generating code. It is not good at understanding systems. It will make it faster and easier than ever to produce code you don’t fully understand, running on abstractions you’ve never examined, with failure modes you won’t discover until they’re your problem in production at 2am.</p><p>The developers who will be most valuable in that world aren’t the fastest writers. The AI handles writing. The bottleneck becomes something else entirely, the ability to look at a system code you wrote, code the AI wrote, code nobody wrote intentionally, but that emerged from accumulated decisions, and understand what it’s actually doing.</p><p>That’s a skill you build by practicing comprehension, not production.</p><h3>What I Took Away From error -8</h3><p>Two hours for one config flag sounds like a failure. Looking back, it was one of the more useful debugging sessions I’ve had.</p><p>Not because I learned about 32-bit versus 64-bit kernel compilation, though I did. But because it forced me to understand the <em>entire chain</em> between “kernel boots” and “user program runs.” The binary format subsystem. The way initramfs works. Why a statically linked binary matters. None of these were things I needed to know. All of them made me better at reasoning about systems in general.</p><p>The error message was bad. The lesson was good.</p><p>We have spent twenty years making it easier to write code. That’s been genuinely valuable, and it’s going to keep accelerating. But writing is not the bottleneck anymore.</p><p>Understanding is. And that’s a different skill entirely.</p><p><em>If this resonated, I also write about systems programming, Rust, and the less discussed parts of how software actually works. Follow for more.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a469de5e8921" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Your First Rust Linux Kernel Module: From Zero to insmod]]></title>
            <link>https://medium.com/@sumant1122/writing-your-first-rust-linux-kernel-module-from-zero-to-insmod-d49669eb6737?source=rss-c21ed862b5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d49669eb6737</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sumant Sogikar]]></dc:creator>
            <pubDate>Wed, 06 May 2026 17:20:41 GMT</pubDate>
            <atom:updated>2026-05-06T17:20:41.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TJ19c1nS3YAYEX2Z" /><figcaption>Photo by <a href="https://unsplash.com/@dkomow?utm_source=medium&amp;utm_medium=referral">Daniil Komov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><em>You know Rust. You’ve heard the kernel is getting Rust support. You’re curious what that actually looks like. This guide walks you through compiling a Rust enabled Linux kernel, booting it in QEMU, and loading a kernel module you wrote yourself without touching your host system.</em></p><h3>What You’ll Build</h3><p>By the end of this guide you will have:</p><ul><li>A Linux kernel compiled from source with Rust support enabled</li><li>A minimal root filesystem booted inside QEMU</li><li>A Rust kernel module (.ko) you can insmod, inspect with dmesg, and rmmod</li></ul><p>Everything runs inside QEMU. Your host machine is never at risk.</p><h3>Prerequisites</h3><ul><li>Debian / Ubuntu 22.04 or 24.04 (or any Debian-based distro)</li><li>~20 GB free disk space (the kernel source tree is large)</li><li>Patience for the first build as it takes 10–30 minutes</li></ul><h3><strong>Step 1 : Install System Dependencies</strong></h3><pre>sudo apt update &amp;&amp; sudo apt install -y \<br>  git curl build-essential flex bison \<br>  libssl-dev libelf-dev libncurses-dev \<br>  qemu-system-x86 cpio busybox-static \<br>  python3 python3-pip clang llvm lld \<br>  bc pahole zstd</pre><p>A few packages worth calling out:</p><ul><li>busybox-static : a statically linked minimal userspace. The <em>static</em> part matters enormously. We&#39;ll come back to it in Step 7.</li><li>clang, llvm, lld : Rust kernel support is built on LLVM. The GNU toolchain won&#39;t work here.</li><li>pahole: needed for BTF (BPF Type Format) debug info that modern kernels require.</li></ul><h3>Step 2 : Install Rust via rustup</h3><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf https://sh.rustup.rs | sh<br># Choose option 1 (default install)<br><br>source $HOME/.cargo/env<br><br>rustc --version<br>cargo --version</pre><p>Now add the components the kernel build system needs:</p><pre>rustup component add rust-src rustfmt clippy<br>cargo install bindgen-cli</pre><blockquote><strong>Don’t skip </strong><strong>bindgen-cli.</strong> The kernel uses bindgen to auto-generate Rust FFI bindings from C headers. It&#39;s a required part of the Rust-for-Linux build pipeline. It&#39;s installed via cargo, not rustup, which makes it easy to miss. If it&#39;s absent, the build will fail with a cryptic error later.</blockquote><h3>Step 3 : Clone the Linux Kernel Source</h3><pre>mkdir ~/kernel-dev &amp;&amp; cd ~/kernel-dev<br><br>git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git<br><br>cd linux</pre><p>--depth=1 skips the full git history. The kernel repo is ~4 GB unshallowed. You don&#39;t need that for this guide.</p><p>You can always run git fetch --unshallow later if you want the full history.</p><h3>Step 4 : Verify Rust is Detected by the Kernel Build System</h3><p>Before touching any config, run this:</p><pre>make LLVM=1 rustavailable</pre><p>If you see Rust is available!, you&#39;re good. If not, the output tells you exactly what&#39;s missing.</p><blockquote><strong>⚠️ Always run this before opening </strong><strong>menuconfig.</strong> If rustavailable doesn&#39;t pass, the Rust support option will be <em>silently hidden</em> in the config menu with no error, no warning. You&#39;ll spend time wondering why the option doesn&#39;t exist. Also, always invoke menuconfig as make LLVM=1 menuconfig, without LLVM=1, Rust options stay hidden regardless of your toolchain state.</blockquote><h3>Step 5 : Configure the Kernel</h3><p>We start from allnoconfig, every option set to its minimum possible value. This is a completely blank slate that produces a tiny, fast-to-compile kernel. We then enable only what we need.</p><pre>make LLVM=1 allnoconfig</pre><p>Now enable all required options:</p><pre># 64-bit kernel<br>scripts/config --enable CONFIG_64BIT<br><br># initramfs support<br>scripts/config --enable CONFIG_BLK_DEV_INITRD<br><br># devtmpfs auto-populates /dev before userspace starts<br>scripts/config --enable CONFIG_DEVTMPFS<br>scripts/config --enable CONFIG_DEVTMPFS_MOUNT<br><br># Serial console required to see output with -nographic in QEMU<br>scripts/config --enable CONFIG_TTY<br>scripts/config --enable CONFIG_SERIAL_8250<br>scripts/config --enable CONFIG_SERIAL_8250_CONSOLE<br><br># Binary format support without these the kernel cannot execute ANY program<br>scripts/config --enable CONFIG_BINFMT_ELF<br>scripts/config --enable CONFIG_BINFMT_SCRIPT<br><br># Loadable module support<br>scripts/config --enable CONFIG_MODULES<br>scripts/config --enable CONFIG_MODULE_UNLOAD<br><br># printk required for pr_info! and all Rust print macros<br>scripts/config --enable CONFIG_PRINTK<br><br># Rust the master switch<br>scripts/config --enable CONFIG_RUST<br><br># Rust sample modules<br>scripts/config --enable CONFIG_SAMPLES<br>scripts/config --enable CONFIG_SAMPLES_RUST<br><br>make LLVM=1 olddefconfig</pre><p>Verify everything took:</p><pre>grep -E &quot;CONFIG_64BIT|CONFIG_MODULES=|CONFIG_MODULE_UNLOAD|CONFIG_RUST=|CONFIG_PRINTK=|CONFIG_BINFMT_ELF|CONFIG_BINFMT_SCRIPT|CONFIG_SERIAL_8250_CONSOLE&quot; .config</pre><p><strong>Why each option matters:</strong></p><ul><li><strong>CONFIG_64BIT</strong> : allnoconfig defaults to 32-bit x86, the most conservative baseline. Your host busybox binary is 64-bit. Without this, every program fails with error -8 (ENOEXEC) at runtime.</li><li><strong>CONFIG_BINFMT_ELF + </strong><strong>CONFIG_BINFMT_SCRIPT</strong> : the kernel has a binary format subsystem. Without these, it literally cannot execute any program, not busybox, not your /init script, nothing. The errors look like mysterious init failures with no obvious cause.</li><li><strong>CONFIG_MODULES</strong> : without this, =m silently becomes =y everywhere. No .ko files are ever produced and insmod/rmmod don&#39;t exist in the kernel.</li><li><strong>CONFIG_MODULE_UNLOAD</strong>: loading and unloading are separate features. CONFIG_MODULES alone only enables insmod. You need this separately for rmmod to work.</li><li><strong>CONFIG_PRINTK</strong> : pr_info!() in Rust maps to the kernel&#39;s printk(). Without this, the Rust print symbols don&#39;t exist in vmlinux and your module fails to link.</li><li><strong>CONFIG_RUST</strong>: the master switch that activates the entire Rust build pipeline: rustc invocations, bindgen runs, the kernel crate, and the module! macro. It lives under &quot;Kernel hacking&quot; because Rust is still a developer feature, not yet used in any core production subsystem.</li></ul><h3>Step 6 : Build the Kernel</h3><pre>make LLVM=1 -j$(nproc)</pre><p>This uses all your CPU cores. Expect 10–30 minutes the first time. Subsequent incremental builds are much faster.</p><p>make only recompiles files affected by changes.</p><p>Verify the output:</p><pre>ls -lh arch/x86/boot/bzImage</pre><p>You should see a file around 5–10 MB. That’s your kernel.</p><h3>Step 7 : Build a Minimal Root Filesystem</h3><p>The kernel needs something to boot <em>into</em>. We’ll build a tiny root filesystem from busybox, just enough to get a shell.</p><blockquote><strong>⚠️ Use the static busybox binary. This is critical.</strong> A dynamically linked binary depends on shared libraries (.so files) that won&#39;t exist inside our minimal initramfs. The kernel will fail with error -8 (ENOEXEC) trying to run it. A statically linked binary has everything bundled inside itself.</blockquote><blockquote>Always verify before copying:</blockquote><pre>file /bin/busybox.static<br># Must say: statically linked</pre><pre>cd ~/kernel-dev<br>mkdir -p initramfs/{bin,sbin,dev,proc,sys,tmp}<br><br># Copy the STATIC busybox (not /bin/busybox which is dynamically linked)<br>cp /bin/busybox.static initramfs/bin/busybox<br><br># Create symlinks for commands our init script needs<br>cd initramfs/bin<br>ln -s busybox sh<br>ln -s busybox ls<br>ln -s busybox mount<br>cd ~/kernel-dev<br><br># Create the init script (PID 1, the first process the kernel runs)<br>cat &gt; initramfs/init &lt;&lt; &#39;EOF&#39;<br>#!/bin/sh<br>mount -t proc none /proc<br>mount -t sysfs none /sys<br>mount -t devtmpfs none /dev<br>echo &quot;=== Rust Kernel Boot Success ===&quot;<br>echo &quot;Kernel: $(uname -r)&quot;<br>exec /bin/sh<br>EOF<br><br>chmod +x initramfs/init<br><br># Package it as a cpio archive<br>cd initramfs<br>find . | cpio -H newc -o | gzip &gt; ../initramfs.cpio.gz<br>cd ..</pre><blockquote><strong>Important mental model:</strong> the initramfs/ folder and initramfs.cpio.gz are two separate things. Editing files in the folder does <strong>not</strong> automatically update the archive. You must always re-run the find . | cpio ... command after any change before rebooting QEMU.</blockquote><h3>Step 8 : Boot Your Kernel in QEMU</h3><pre>qemu-system-x86_64 \<br>  -kernel ~/kernel-dev/linux/arch/x86/boot/bzImage \<br>  -initrd ~/kernel-dev/initramfs.cpio.gz \<br>  -append &quot;console=ttyS0 nokaslr&quot; \<br>  -nographic \<br>  -m 512M</pre><blockquote><strong>Use absolute paths</strong> (~/kernel-dev/...). Relative paths cause QEMU to silently fall back to &quot;Booting from ROM&quot;, a confusing failure where the kernel you built is never loaded.</blockquote><blockquote><strong>-nographic streams all output to your terminal, </strong>no window opens. Run the command as a single block; the \ line continuations require it.</blockquote><p>You should see the kernel boot log, ending with:</p><pre>=== Rust Kernel Boot Success ===<br>Kernel: 6.x.x<br>/ #</pre><p>That / # is a shell prompt <em>inside your kernel</em>. You compiled and booted Linux from source.</p><p><strong>To exit QEMU:</strong> press Ctrl+A, then X.</p><h3>Step 9 : Write Your First Rust Kernel Module</h3><p>Back in the kernel source tree:</p><pre>cd ~/kernel-dev/linux<br>mkdir -p samples/rust/hello_kernel</pre><p>Create the module source:</p><pre>cat &gt; samples/rust/hello_kernel/hello.rs &lt;&lt; &#39;EOF&#39;<br>// SPDX-License-Identifier: GPL-2.0<br><br>//! A minimal Rust kernel module.<br><br>use kernel::prelude::*;<br><br>module! {<br>    type: HelloModule,<br>    name: &quot;hello_rust&quot;,<br>    author: &quot;Your Name&quot;,<br>    description: &quot;My first Rust kernel module&quot;,<br>    license: &quot;GPL&quot;,<br>}<br><br>struct HelloModule;<br><br>impl kernel::Module for HelloModule {<br>    fn init(_module: &amp;&#39;static ThisModule) -&gt; Result&lt;Self&gt; {<br>        pr_info!(&quot;Hello from Rust kernel module!\n&quot;);<br>        Ok(HelloModule)<br>    }<br>}<br><br>impl Drop for HelloModule {<br>    fn drop(&amp;mut self) {<br>        pr_info!(&quot;Goodbye from Rust kernel module!\n&quot;);<br>    }<br>}<br>EOF</pre><p>Add a Kconfig entry:</p><pre>cat &gt; samples/rust/hello_kernel/Kconfig &lt;&lt; &#39;EOF&#39;<br>config SAMPLE_RUST_HELLO<br>    tristate &quot;Hello Rust kernel module&quot;<br>    depends on RUST<br>    help<br>      A minimal Rust kernel module for learning purposes.<br>EOF</pre><p>Add a Makefile:</p><pre>cat &gt; samples/rust/hello_kernel/Makefile &lt;&lt; &#39;EOF&#39;<br>obj-$(CONFIG_SAMPLE_RUST_HELLO) += hello.o<br>EOF</pre><blockquote><strong>⚠️ Wire the module into the parent build system.</strong> The kernel build system is a tree of Makefiles. Each parent must explicitly include its children, nothing is auto-discovered. Without this step, make never enters your directory and nothing gets built. This is the most common reason hello.ko doesn&#39;t appear after building.</blockquote><pre># Tell the parent Kconfig about your module<br>cat &gt;&gt; ~/kernel-dev/linux/samples/rust/Kconfig &lt;&lt; &#39;EOF&#39;<br><br>source &quot;samples/rust/hello_kernel/Kconfig&quot;<br>EOF<br><br># Tell the parent Makefile to build your directory<br>cat &gt;&gt; ~/kernel-dev/linux/samples/rust/Makefile &lt;&lt; &#39;EOF&#39;<br>obj-$(CONFIG_SAMPLE_RUST_HELLO) += hello_kernel/<br>EOF</pre><p>Enable the module as a loadable module (not built-in):</p><pre>scripts/config --module CONFIG_SAMPLE_RUST_HELLO<br>make LLVM=1 olddefconfig<br><br># Verify: must show =m not =y<br>grep &quot;CONFIG_SAMPLE_RUST_HELLO&quot; .config</pre><p><strong>y vs </strong><strong>m why it matters:</strong></p><ul><li>=y compiles the module permanently into the kernel image. It&#39;s always there. You can&#39;t unload it.</li><li>=m produces a .ko file you can insmod, test, rmmod, modify, and reload — without rebooting.</li></ul><p>For development, always use =m. That loop, load, test, unload, modify, repeat is your entire workflow.</p><h3>Step 10 : Build the Module</h3><pre># Pass 1: build the kernel<br>make LLVM=1 -j$(nproc)<br><br># Pass 2: build all modules<br>make LLVM=1 -j$(nproc) modules</pre><p>Why two passes? The kernel build is a two-stage process:</p><ol><li><strong>Pass 1</strong> compiles hello.rs → hello.o + hello.mod (metadata)</li><li><strong>Pass 2</strong> runs modpost, which links hello.o + hello.mod → hello.ko and verifies that every kernel symbol your module uses actually exists in your compiled vmlinux. If a symbol is missing, it errors at build time — not silently at insmod time.</li></ol><p>Find your module:</p><pre>find . -name &quot;hello*.ko&quot;<br># ./samples/rust/hello_kernel/hello.ko</pre><h3>Step 11 : Load the Module Inside QEMU</h3><p>Copy the module into the initramfs, rebuild the archive, and reboot:</p><pre>cd ~/kernel-dev<br>cp linux/samples/rust/hello_kernel/hello.ko initramfs/<br>cd initramfs<br>find . | cpio -H newc -o | gzip &gt; ../initramfs.cpio.gz<br>cd ..<br><br>qemu-system-x86_64 \<br>  -kernel ~/kernel-dev/linux/arch/x86/boot/bzImage \<br>  -initrd ~/kernel-dev/initramfs.cpio.gz \<br>  -append &quot;console=ttyS0 nokaslr&quot; \<br>  -nographic \<br>  -m 512M</pre><p>Inside the QEMU shell:</p><pre>insmod /hello.ko<br>dmesg | tail<br># Hello from Rust kernel module!<br><br>rmmod hello_rust<br>dmesg | tail<br># Goodbye from Rust kernel module!</pre><h3>What Just Happened</h3><p>That Goodbye message is Rust&#39;s Drop trait firing. The kernel called your cleanup code automatically as part of unloading the module.</p><p>In C, you’d write a separate module_exit() function and manually ensure it mirrors everything module_init() did. Forget a cleanup step and you have a resource leak or a kernel hang. In Rust, Drop handles it and the compiler enforces you can&#39;t forget it.</p><p>One line in dmesg is a live demonstration of why Rust in the kernel matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*aSt79FzmA8a-j4QTiUrS-w.png" /></figure><h3>Where to Go Next</h3><ul><li><a href="https://github.com/Rust-for-Linux/linux">Rust-for-Linux GitHub</a> — the upstream development tree</li><li><a href="https://www.kernel.org/doc/html/latest/rust/index.html">Kernel Rust documentation</a> — also available at Documentation/rust/ in your local tree</li></ul><p><em>More coming. There’s a lot more to explore. Driver abstractions, memory management, concurrency primitives, all in Rust, all in the kernel. I’ll be covering it piece by piece. Follow along.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d49669eb6737" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>