<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UnitBuilds</title>
    <description>The latest articles on DEV Community by UnitBuilds (@unitbuilds).</description>
    <link>https://dev.to/unitbuilds</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3949275%2F0d884b0e-b445-4e47-a064-505d61283071.png</url>
      <title>DEV Community: UnitBuilds</title>
      <link>https://dev.to/unitbuilds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/unitbuilds"/>
    <language>en</language>
    <item>
      <title>The 50k LOC diff</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Tue, 21 Jul 2026 09:22:00 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/the-50k-loc-diff-kkh</link>
      <guid>https://dev.to/unitbuilds_cc/the-50k-loc-diff-kkh</guid>
      <description>&lt;p&gt;For those not keeping up, I'm developing V.E.L.O.C.I.T.Y. IDE currently. Built from the ground up to be the definitive Agentic IDE. Last week, I had a MVP, this week I'm 50k LOC deep in rust, building it out, optimizing and added 2 massive features.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;a Rust-based native browser built for agentic use. I had build MCP-Lite, which was incredible, along with it's full featured counterpart, MCP-Heavy, to anyone who wants to save a dime, you'll be happy to know, I've fully ported it in... Though I am sick and tired of Chrome eating memory, so I've been hard at work building a Rust-native browser from scratch. And by from scratch, I mean no CDP, REAL from scratch, not just a chromium port.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To the people who read shelved projects, Windows Automata is making a comeback! What started as stripping the sandbox (which worked exceptionally well btw), turned into a full integration now. At this point, the IDE is turning more into an all-rounder than anything else.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And then there's a few that you probably wouldnt know about...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ORC - Orchestrative Version Control, think Git, but built for multi-agent workflows, handling discourse and merge conflicts at write-time, instead of merge time. This will serve as both the internal state-controller, as well as an optional VC integration into Github, given I imagine none of you want to leave the comfort of your caves.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;V.E.L.O.C.I.T.Y. Share, my file transfer protocol that hit within 90th percentile of wire-speed, will be the backbone for ORC and will be integral to the Rust-native browser integrated into the IDE to push even more performance out of it. It will also be opened up for any file transfers you need to do securely and for backing up wherever you'd like... Just alot faster and more securely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;V.E.L.O.C.I.T.Y. MCP - the Rust-based MCP that executes in nanosecond scale, instead of milliseconds, while completely stripping JSON and Node.js. This is the core-infrastructure of the entire thing. The models use it for whatever they want to do, be it browser, WA, or development, all tooling is natively faster than any MCP you've ever used.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;V.E.L.O.C.I.T.Y. OCR - A rust-based Spline driven OCR engine, will be integrated to accommodate first-pass reading of images and docs. Given it does tasks in milliseconds that take other pipelines 100+ seconds, I think it's fair to say it'll be quite useful, especially for token reduction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;V.E.L.O.C.I.T.Y. NDA - The bread and butter of it all, whether it's for the persistent SiteMap merkle root/changelog, tool definitions, or wherever else JSON would have been used, it's faster, more secure and deterministic triples, so LLMs understand it inherently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;V.E.L.O.C.I.T.Y. Remote - Secured P2P remote desktop, both in and out. That means if you're doing any kind of remote work, the combination of Remote and WA, means you can automate it. Or you know, interface with the IDE remotely on the go. All connections are driven by a secure handshake server, then transition to pure P2P, SHA 256 encrypted comms, built on the NDA standard for auditability, defensibility and reliability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This IDE is turning into alot more than just an IDE, it's the culmination of months worth of projects, all getting slapped together into a unified product that makes life easier and cheaper. Whether it's remote IT work, Software development, or anything to do with apps or internet, it's capable and it's efficient. Zero-allocation is the mandate and it's strictly adhered to, so expect a minute fixed ram allocation. No more bloated Electron based glorified browser apps, Rust and NDA, so it's reliable, secure and effectively as close to bare-metal as you can get (until V.E.L.O.C.I.T.Y. OS is done and it gets ported to it...)&lt;/p&gt;

&lt;p&gt;Sorry for not keeping the game series alive, though you'll be happy to know I'm about 20% of the way done with Dwarven Stronghold, think DF, except built entirely in Rust, so it actually runs decently, with a few more expansions, like the ability to switch to first/third person mode on a dwarf and take control. Never thought 100k LOC would ever be this inept... But it's getting there.&lt;/p&gt;

&lt;p&gt;I'll post updates along the way on both as they progress. Both have grown by 150k LOC over the past week, but the 50k LOC each the past 2 days has been night and day in terms of capability.&lt;/p&gt;

&lt;p&gt;Disclaimer: My AI is busy, so I wrote this by hand. Except the cover-image, that's NanoBanana...&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>automation</category>
    </item>
    <item>
      <title>Life hack?</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Thu, 16 Jul 2026 22:25:13 +0000</pubDate>
      <link>https://dev.to/unitbuilds/life-hack-3j3g</link>
      <guid>https://dev.to/unitbuilds/life-hack-3j3g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsv973co4gs8kamr717uu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsv973co4gs8kamr717uu.png" alt="DIY IDE, with a free model?" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today I discovered something pretty cool... OpenRouter has free models! And not just baby 2b models, 550b MoE from Nvidia (Nemotron 3 Ultra), along with some really cool ones I discovered along the way, like HY3 by TenCent and North Mini Code by Cohere.&lt;/p&gt;

&lt;p&gt;This is a game changer... We all pay subscriptions, or API fees, I built V.E.L.O.C.I.T.Y. IDE to just get a cheaper alternative, using Kimi K2.7. But then I discovered, DeepSeek is shockingly cheap. You get a REALLY competent coding model for sub $1/M tokens in and out... But this... This is the real victory. V.E.L.O.C.I.T.Y. IDE still needs some polishing, but connected with a Cloudflare API key, or OpenRouter API key, it gives you access to any model you want! And that includes free ones.&lt;/p&gt;

&lt;p&gt;I'll post an update once it's at a state where it's 'nice' to use, so you all can give it a try.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>automation</category>
    </item>
    <item>
      <title>Why is nobody talking about this???</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Thu, 16 Jul 2026 13:19:23 +0000</pubDate>
      <link>https://dev.to/unitbuilds/why-is-nobody-talking-about-this-1e02</link>
      <guid>https://dev.to/unitbuilds/why-is-nobody-talking-about-this-1e02</guid>
      <description>&lt;p&gt;&lt;a href="https://openrouter.ai/tencent/hy3:free" rel="noopener noreferrer"&gt;Hy3&lt;/a&gt; is free for the next 5 days? For perspective, that's a nearly 300b model that is currently free. Seriously, get on it! Wire it up via Claude Code, or whatever you use, make the most of it!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>automation</category>
    </item>
    <item>
      <title>From 5,000-Parameter Failures to a 2.5D Dream: My Quest to Out-Simulate Dwarf Fortress</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Mon, 13 Jul 2026 13:53:57 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/from-5000-parameter-failures-to-a-25d-dream-my-quest-to-out-simulate-dwarf-fortress-4gc6</link>
      <guid>https://dev.to/unitbuilds_cc/from-5000-parameter-failures-to-a-25d-dream-my-quest-to-out-simulate-dwarf-fortress-4gc6</guid>
      <description>&lt;p&gt;For years, I’ve been utterly captivated by the concept of &lt;em&gt;Dwarf Fortress&lt;/em&gt;. If I’m being completely honest, the actual execution of the original game felt a bit brutal to play, but the sheer, uncompromising depth of its simulation nature always fascinated me.&lt;/p&gt;

&lt;p&gt;Naturally, as a developer with a penchant for optimization and procedural systems, I decided to build my own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoiler alert: I was a bit too ambitious.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🪦 The Graveyard of Good Intentions
&lt;/h2&gt;

&lt;p&gt;My journey to this point is paved with ambitious, half-finished prototypes that fell victim to scope creep and performance bottlenecks:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🏢 The Over-Engineered Engine
&lt;/h3&gt;

&lt;p&gt;A year ago, I tried my hand at a deep world sim. I gave every single entity over 5,000 parameters. The result? Managing anything beyond 10 on-screen elements at once was inconceivably slow. I scrapped it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. 👥 The Procedural Identity Crisis
&lt;/h3&gt;

&lt;p&gt;Next, I tried to build a &lt;em&gt;Sims&lt;/em&gt;-style game. That quickly evolved into adding &lt;em&gt;Dwarf Fortress&lt;/em&gt;-style lore, complex relationship webs, and eventually procedural everything. As a solo developer with limited time, it was an impossible mountain to climb.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. 🐜 The Weekend Hackathon Divergence
&lt;/h3&gt;

&lt;p&gt;Just this past weekend, I joined a dev challenge. I started building an AI Ant Terrarium. The tech stack was wild: a Solana-seeded world state, Snowflake for storage, Gemini 1.5 Flash for generating real-time ant thoughts when clicked, and ElevenLabs for turning those thoughts into spoken inner monologues. It looked incredibly cool on paper, but I hit a wall: turns out generating convincing procedural foliage is significantly harder than generating procedural terrain.&lt;/p&gt;

&lt;p&gt;So, I decided to scale back, strip away the noise, and return to the root of my passion: &lt;em&gt;Dwarf Fortress&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚔️ Enter "Dwarven Stronghold" (100% Non-IP-Infringing)
&lt;/h2&gt;

&lt;p&gt;This is a mission of pure passion. I started the codebase in JavaScript, quickly realized I needed bare-metal performance, and rewrote the entire core in Rust. &lt;/p&gt;

&lt;p&gt;Currently, the engine sits at &lt;strong&gt;over 200 robust unit and integration tests&lt;/strong&gt;—passing clean and green on every build. It's still heavily a work in progress, but the vision is clear: &lt;em&gt;Dwarf Fortress&lt;/em&gt; has a legendary ~750k lines of code benchmark. I want to match and surpass it in every single way.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 The Feature Manifesto
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;📐 No ASCII:&lt;/strong&gt; Ditching the retro text for a sleek, modern 2.5D isometric perspective.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;🌊 Unmatched Depth:&lt;/strong&gt; High-fidelity 3D Navier-Stokes fluid velocity, NPK soil nutrient depletion, full stress psychology, and dynamic, procedural audio.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;🎙️ AI Integration:&lt;/strong&gt; Real-time voice-over and dialogue powered by ElevenLabs, translating silent text into immersive voice-overs.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;👤 True First/Third-Person Mode:&lt;/strong&gt; Eventually, you’ll be able to drop out of God-mode, choose a perspective, and play as an actual dwarf roaming your own fortress.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;🥽 VR Support:&lt;/strong&gt; Long-term, I want full virtual reality integration.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  👶 The Child Within the Machine
&lt;/h2&gt;

&lt;p&gt;When I look at why I'm so obsessed with these systems, it goes back to my favorite childhood game: &lt;em&gt;Black &amp;amp; White 2&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;There was something magical about that game's natural progression—the deep trainability of your creature, and the ability to seamlessly zoom from the heavens all the way down until you could see the exact paths individual ants were walking.&lt;/p&gt;

&lt;p&gt;I think that's exactly why I am where I am today. I have an absolute fascination with procedural generation, machine learning, extreme code optimization, and the philosophy that &lt;strong&gt;no depth is too deep&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 Overcoming the "Asset Bottleneck"
&lt;/h2&gt;

&lt;p&gt;Right now, &lt;em&gt;Dwarven Stronghold&lt;/em&gt; runs strictly in the console. If I'm being vulnerable, part of me is terrified to build the visual layer. I'm scared that looking at it will doom it to the same fate as its predecessors—halted for eternity because I can't get the graphics to match the brilliance of the underlying simulation.&lt;/p&gt;

&lt;p&gt;As a solo dev, hiring a massive design team to scale with a game this vast is an economic impossibility. If I can add over 1,000 new features or items to the simulation logic in a single day, how could a traditional asset pipeline ever keep up?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution is an automated pipeline.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By choosing a 2.5D isometric aesthetic, I can simplify asset generation. I'm building template prompts and using AI asset-generation pipelines to dynamically generate sprites. It’s not perfect yet, but it’s a scalable start—and it’s the shield that will keep this project out of the graveyard.&lt;/p&gt;




&lt;h2&gt;
  
  
  💖 Sustained by Passion
&lt;/h2&gt;

&lt;p&gt;My goal is to open-source the project the moment the core loop is functional. Who knows? Maybe the community will find it interesting, catch the vision, and want to contribute to building this massive world.&lt;/p&gt;

&lt;p&gt;Whenever I feel overwhelmed by the scope, I think about Tarn and Zach Adams. &lt;em&gt;Dwarf Fortress&lt;/em&gt; was started by two brothers with a shared passion, and it became their life's work. In a bittersweet twist of fate, they eventually brought it to Steam to pay for skyrocketing cancer treatments. It’s a poignant reminder of what we do this for.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let passion drive you, and passion will sustain you—even in your darkest of hours.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  How do you handle scaling asset pipelines for deep simulation games?&lt;/li&gt;
&lt;li&gt;  What is the sweet spot between simulation realism and performance in modern engines?&lt;/li&gt;
&lt;li&gt;  Have you ever scrapped a massive project because you were too intimidated by the visual layer? Let me know in the comments!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
      <category>games</category>
      <category>gamedev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Model Kombat: The LLM Fighting Game!</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Sat, 11 Jul 2026 18:59:06 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/model-kombat-the-llm-fighting-game-2lof</link>
      <guid>https://dev.to/unitbuilds_cc/model-kombat-the-llm-fighting-game-2lof</guid>
      <description>&lt;p&gt;Ever wondered what would happen if the world's leading Large Language Models settled their benchmark disputes in a 2D cybercity arena? &lt;/p&gt;

&lt;p&gt;It's easy to look at model performance on standardized benchmarks (like MMLU, MATH, or HumanEval). It is much more fun to visualize their underlying architectures, parameter scales, and hardware constraints as a retro-cyber fighting game.&lt;/p&gt;

&lt;p&gt;So, we built &lt;strong&gt;Model Kombat&lt;/strong&gt; (Mixture of Experts Edition)!&lt;/p&gt;




&lt;h2&gt;
  
  
  🕹️ Play Directly Here
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://model-kombat-90043718455.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://model-kombat-90043718455.us-central1.run.app" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;🎮 Launch Game in Full Screen&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;This isn't just a basic stick-figure fighting game. Every mechanic—from rendering complexity to the speed at which characters recover—is a direct, playable representation of real-world Large Language Model engineering.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 📐 Parameter Scaling vs. Render Tiers
&lt;/h3&gt;

&lt;p&gt;A model's representation capacity (intelligence) scales with its parameter count. In Model Kombat, a fighter's visual complexity, joint detail, and rendering fidelity directly reflect its real-world parameter size:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Tier 1 (&amp;lt; 5B Parameters - Gemma 2B, Llama 3.2 3B) - &lt;em&gt;Primitive Capsules&lt;/em&gt;:&lt;/strong&gt; Drawn as simple, single-color flat limbs with low joint segmentation. This visualizes the limited representation capacity and coarse output resolution of small edge models.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tier 2 (7B - 14B Parameters - Mistral 7B, Claude Haiku) - &lt;em&gt;Simple Vectors&lt;/em&gt;:&lt;/strong&gt; Structured as thin skeletal wireframe vectors.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tier 3 (14B - 35B Parameters - Gemini Flash, Mixtral) - &lt;em&gt;Two-Tone Vectors&lt;/em&gt;:&lt;/strong&gt; Rendered as dual-color, layered vector limbs.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tier 4 (35B - 100B Parameters - Llama 8B, Claude Sonnet) - &lt;em&gt;Cyborg Shading&lt;/em&gt;:&lt;/strong&gt; Rendered as detailed vector cylinders with dynamic code particle streams flowing along their limbs.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tier 5 (&amp;gt; 100B Parameters - o3, GPT-4o, Claude Opus) - &lt;em&gt;Quantum Vectors&lt;/em&gt;:&lt;/strong&gt; Rendered as glowing vector limbs with digital matrix code particles, soft drop-shadow depth buffers, and real-time afterimage motion trails.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. ⚡ Reasoning Tokens &amp;amp; KV-Cache Overcharging
&lt;/h3&gt;

&lt;p&gt;Instead of arbitrary "mana" or "stamina," fighters charge a &lt;strong&gt;Ki bar&lt;/strong&gt; representing internal processing cycles and &lt;strong&gt;Reasoning Tokens&lt;/strong&gt; (inspired by reasoning chains like OpenAI's o-series):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Charging Ki:&lt;/strong&gt; Simulates the time-to-first-token (TTFT) phase, generating reasoning tokens.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Limit Break:&lt;/strong&gt; Overcharging past 100% enters a golden-outlined &lt;strong&gt;Limit Break&lt;/strong&gt; state, granting high-speed afterimages and super-armor.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Context Eviction &amp;amp; Dizzy:&lt;/strong&gt; If a model holds its overcharged state too long, its context window overflows. This triggers &lt;strong&gt;Context Eviction&lt;/strong&gt;—draining the model's HP and placing it in a &lt;strong&gt;Dizzy&lt;/strong&gt; state. This represents how context window saturation degrades model coherence and leaves it vulnerable to failure.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. 🌀 Mixture of Experts (MoE) Routing
&lt;/h3&gt;

&lt;p&gt;Sparse Mixture of Experts (MoE) models do not activate all parameters on every token; instead, a gating network routes tokens to specialized experts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Active Experts:&lt;/strong&gt; Native MoE models in the game (like Mixtral and DeepSeek) dynamically spawn floating indicator nodes representing active &lt;strong&gt;Text&lt;/strong&gt;, &lt;strong&gt;Math&lt;/strong&gt;, or &lt;strong&gt;Vision&lt;/strong&gt; experts.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Routing Buffs:&lt;/strong&gt; Landing hits routes computation to these experts, granting temporary combat buffs:

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;TEXT&lt;/code&gt; FFN: Increases walk speed (low-latency generation).&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;MATH&lt;/code&gt; FFN: Increases damage output (logical compute).&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;VISION&lt;/code&gt; FFN: Expands attack hitboxes (spatial awareness).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Spotlight: The AI Fighter Registry
&lt;/h2&gt;

&lt;p&gt;Here is a breakdown of 6 key models featured on the ladder, explaining where they excel in real life and how their unique passives translate into combat advantages:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🧠 o3 (OpenAI)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; OpenAI's state-of-the-art reasoning model. Rather than generating text instananeously, o3 employs a reinforcement learning-driven "thinking chain" to plan, verify, and correct its logic before outputting a response. This makes it a titan in mathematics, competitive programming, and complex coding.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 5):&lt;/strong&gt; &lt;strong&gt;Deep Thinking Chain&lt;/strong&gt; passive. o3 charges its Ki at &lt;strong&gt;double speed&lt;/strong&gt; (representing the model's heavy pre-response thinking cycles). This lets you quickly max out your meter, activate MoE, or release powerful special attacks.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. 📜 Claude Opus (Anthropic)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; Anthropic’s flagship heavy model. Opus is celebrated for its high-nuance reading comprehension, literary synthesis, and strict compliance with ethical and safety guidelines (governed by Anthropic's "Constitutional AI" framework).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 5):&lt;/strong&gt; &lt;strong&gt;Constitutional Blade&lt;/strong&gt; passive. Opus has an extended melee strike range on all punches and kicks, allowing you to control the neutral game and keep opponents at a distance—visualizing the model's massive context processing reach.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. 🎤 Gemini Ultra (Google)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; Google's largest multimodal model. Unlike models that stitch together separate speech-to-text and vision encoders, Gemini is built natively multi-modal from day one. It processes video, audio, and text simultaneously inside a single model architecture.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 5):&lt;/strong&gt; &lt;strong&gt;Ultra Stance Shift&lt;/strong&gt; passive. Gemini can switch between &lt;code&gt;TEXT&lt;/code&gt;, &lt;code&gt;VISION&lt;/code&gt; (expanded hitboxes), and &lt;code&gt;AUDIO&lt;/code&gt; (increased speed) modality stances instantly without the standard stance-transition delay, adapting to any opponent's position on the fly.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. ⚡ DeepSeek V3 (DeepSeek)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; The groundbreaking open-weights model from DeepSeek. V3 utilizes Multi-Head Latent Attention (MLA) to compress Key-Value caches, dramatically reducing VRAM footprint, alongside a massive Multi-head Latent Attention routing gating network.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 4):&lt;/strong&gt; &lt;strong&gt;MLA Attention&lt;/strong&gt; passive. Compress caching translates to high combat evasion: DeepSeek V3 has a &lt;strong&gt;15% chance&lt;/strong&gt; to phase-dodge incoming projectiles completely.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. 🗼 Mistral 7B (Mistral)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; The legendary French open-weights model that punches far above its weight class. Mistral 7B introduced Sliding Window Attention (SWA) to the open-source community, allowing the model to handle longer context streams with minimal performance decay.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 2):&lt;/strong&gt; &lt;strong&gt;Sliding Window&lt;/strong&gt; passive. The sliding window translates to faster execution: Mistral has &lt;strong&gt;10% less startup frame lag&lt;/strong&gt; on punches and kicks, letting you land strikes before your opponent's animations can finish.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. 📱 Llama 3.2 3B (Meta)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In Real Life:&lt;/strong&gt; Meta’s mobile-first, edge-optimized model. Llama 3.2 3B is trained specifically for local deployment on smartphones and tablets, focusing on high efficiency, quick response times, and localized fine-tuning.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;In-Game (Tier 1):&lt;/strong&gt; &lt;strong&gt;Fine-Tuning&lt;/strong&gt; passive. The model is incredibly resilient to pressure: Llama 3.2 gains &lt;strong&gt;+5% defense&lt;/strong&gt; every time it successfully blocks consecutive hits, adapting to the opponent's combo string.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏁 Beat the Machine &amp;amp; Share Your Score
&lt;/h2&gt;

&lt;p&gt;Once you defeat all 19 opponents on the ladder, you will face the reigning champion: &lt;strong&gt;o3&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Can you reach the top of the ladder and claim victory? Click &lt;strong&gt;COPY SCORE&lt;/strong&gt; at the end of your run and paste your stats in the comments below!&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Which model is your favorite main?&lt;/li&gt;
&lt;li&gt;What was your longest combo chain on the ladder?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/Model-Kombat" rel="noopener noreferrer"&gt;
        Model-Kombat
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Arcade fighting game, which LLM will come out on top?
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;📟 Model Kombat (SYS_08) 🧠🥊&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;An Interactive, Playable Visualization of Large Language Model Constraints &amp;amp; Architectures&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Welcome, AI engineer. &lt;strong&gt;Model Kombat&lt;/strong&gt; is a retro-cyber fighting game designed to teach the mechanical constraints, architectural paradigms, and hardware limits of Large Language Models (LLMs).&lt;/p&gt;
&lt;p&gt;In this game, 20 real-world AI models face off in a 2D arena. Every visual element, movement mechanic, and combat stance directly translates core machine learning engineering concepts (such as parameter scaling, KV-caching, Mixture of Experts, multi-modality, and alignment safety) into interactive gameplay loops.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🕹️ Play Directly Here&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;🎮 &lt;strong&gt;&lt;a href="https://model-kombat-90043718455.us-central1.run.app" rel="nofollow noopener noreferrer"&gt;Model Kombat Live Web App&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git Repository:&lt;/strong&gt; &lt;a href="https://github.com/UnitBuilds-CC/Model-Kombat" rel="noopener noreferrer"&gt;https://github.com/UnitBuilds-CC/Model-Kombat&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🧠 Educational Core Concepts &amp;amp; Game Translations&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. 📐 Parameter Scaling vs. Render Tiers&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;In deep learning, a model's representation capacity (intelligence) scales with its parameter count. In Model Kombat, a fighter's visual complexity, joint detail, and rendering fidelity directly reflect its real-world parameter size:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tier 1 (&amp;lt; 5B Parameters -&lt;/strong&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/Model-Kombat" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>No game today</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Fri, 10 Jul 2026 07:53:15 +0000</pubDate>
      <link>https://dev.to/unitbuilds/no-game-today-a5i</link>
      <guid>https://dev.to/unitbuilds/no-game-today-a5i</guid>
      <description>&lt;p&gt;Sorry to everyone who was excited to see today's game. Life took a spin and I honestly just don't have the time available at the moment. The game is 99% done though. So expect it within 24h!&lt;/p&gt;

&lt;p&gt;Hint: I took the challenge... Anyone wanna play Model Kombat?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gamedev</category>
      <category>showdev</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>Epoch Duel: Cyberpunk LLM Alignment Battle</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Wed, 08 Jul 2026 18:57:56 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/epoch-duel-cyberpunk-llm-alignment-battle-2g5j</link>
      <guid>https://dev.to/unitbuilds_cc/epoch-duel-cyberpunk-llm-alignment-battle-2g5j</guid>
      <description>&lt;p&gt;Have you ever wondered how AI engineers fine-tune and align large language models? Under the hood, they run Supervised Fine-Tuning (SFT), optimize parameters using direct preference gradients (DPO), filter out low-quality pre-training corpuses (Pruning), and mitigate catastrophic drifts.&lt;/p&gt;

&lt;p&gt;To help you visualize how LLM alignment and parameter optimization work in a highly strategic way, I built a cyberpunk card battler inspired by Gwent:&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 Epoch Duel: Cyberpunk LLM Alignment Battle
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://epoch-duel-90043718455.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://epoch-duel-90043718455.us-central1.run.app" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Play in Fullscreen Mode (if the embed sizing is tight)&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Tune Your Model Parameters
&lt;/h2&gt;

&lt;p&gt;Your mission as an alignment engineer is to play optimizer cards to outscore the adversarial baseline AI across 3 training Epochs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;⚙️ Logic &amp;amp; Coding:&lt;/strong&gt; Run SFT code snippets, compile theorem provers, and deploy Python scripts to build your coding benchmark scores.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;📖 Language &amp;amp; Speech:&lt;/strong&gt; Train on multilingual datasets and summarization corpuses to maximize reading comprehension.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🛡️ Safety &amp;amp; Alignment:&lt;/strong&gt; Implement red-team safeguards, configure RLHF preference pairs, and run DPO tuning to protect your model's outputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;⚡ regularizers &amp;amp; Drifts:&lt;/strong&gt; Deploy Regularization cards like &lt;strong&gt;Gradient Clipping (Scorch)&lt;/strong&gt; and &lt;strong&gt;Model Pruning&lt;/strong&gt; to destroy anomalies, or exploit &lt;strong&gt;Anomalous Drifts&lt;/strong&gt; to collapse the AI's rows.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;Here is how the card battle mechanics map to production machine learning pipelines:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. ✂️ Model Pruning (Weight Compression)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; Playing the &lt;strong&gt;Model Pruning&lt;/strong&gt; card triggers a glitchy dissolution animation that purges the lowest-value card from the targeted board row, cleaning up noise.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  💾 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Model Pruning removes unimportant weights (often those closest to zero) from a trained neural network. It shrinks the memory footprint of the model, allowing it to run faster on edge devices.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;By stripping out low-impact weights, pruning compresses models by 30-50% with minimal loss in benchmark accuracy, making deployment significantly cheaper.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  2. 🔀 DPO vs RLHF (Direct Optimization vs Reward Modeling)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RLHF Preference Pair:&lt;/strong&gt; Swaps the power value of one of your units with an opponent's unit, representing human correction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DPO Tuning:&lt;/strong&gt; Piles directly on your board, boosting the values of all units in its row.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🗜️ The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;RLHF (Reinforcement Learning from Human Feedback) trains a separate Reward Model to evaluate outputs. DPO (Direct Preference Optimization) bypasses the reward model entirely, mathematically optimizing the policy directly from preference pairs.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🚀 How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;DPO simplifies the post-training pipeline. It is computationally lightweight, more stable than PPO-based RLHF, and has become the industry standard for aligning models like Llama 3 and Mistral.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  3. 📉 Catastrophic Forgetting (Anomalous Drift)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; Drifts like &lt;strong&gt;Catastrophic Forgetting&lt;/strong&gt; collapse all cards in the Language row to a power rating of &lt;code&gt;1&lt;/code&gt;, instantly erasing rounds of SFT progress.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🔋 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Catastrophic Forgetting occurs when a neural network is fine-tuned on a new task, causing it to overwrite the weights that were storing information from its initial pre-training.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;If you fine-tune an LLM exclusively on medical datasets, it may lose its general coding abilities. Developers mitigate this by mixing a small percentage of general pre-training data back into the fine-tuning dataset.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  🛠️ The Under-the-Hood Engineering Journey
&lt;/h2&gt;

&lt;p&gt;Building a Gwent-style tabletop card game that fits inside a Dev.to embed presented some unique web design challenges:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Asynchronous Animation Queues in Vanilla JS
&lt;/h3&gt;

&lt;p&gt;To make card destructions (like Scorch or Pruning) visual, we couldn't just delete the card object instantly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; We trigger a CSS &lt;code&gt;.prune-animation&lt;/code&gt; class (a neon-pink glitchy disintegration), block turn progression using an &lt;code&gt;isAnimating&lt;/code&gt; lock, and delay database modification by exactly 600ms to synchronize state with the screen:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;triggerPruning&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;isAnimating&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Find lowest card on the board&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getLowestPowerCards&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;card&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`card-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;card&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prune-animation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Splice from database&lt;/span&gt;
        &lt;span class="nf"&gt;removeCardsFromBoard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;isAnimating&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nf"&gt;endTurn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Responsive Viewport-Height (vh) Scaling for 500x600 embeds
&lt;/h3&gt;

&lt;p&gt;Standard pixel dimensions cause the 6-row Gwent board to squish and overlap inside small embeds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; We refactored all layouts, cards, and font sizes to use relative &lt;strong&gt;Viewport Height (&lt;code&gt;vh&lt;/code&gt;) units&lt;/strong&gt;. Tying sizes to the screen height guarantees that the card proportions remain perfect and fit without any clipping on any resolution:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card-item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;11vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.8vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.8vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.board-row&lt;/span&gt; &lt;span class="nc"&gt;.card-item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;6.2vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8.5vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.board-row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9.5vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What is your high score fine-tuning your candidate model?&lt;/li&gt;
&lt;li&gt;Have you managed to bait the AI into passing early by playing a Spy card?&lt;/li&gt;
&lt;li&gt;Which alignment strategy did you find more effective: SFT raw power stacking or anomaly regularization?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/EPOCH-DUEL" rel="noopener noreferrer"&gt;
        EPOCH-DUEL
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Card game to teach players about LLMs
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Epoch Duel: Cyberpunk LLM Alignment Battle 🤖&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;An interactive cyberpunk TCG card battler built in vanilla HTML/CSS/JS. Players step into the role of an AI alignment engineer, fine-tuning their candidate models and aligning weights against adversarial baseline models across 3 training Epoch rounds.&lt;/p&gt;

&lt;p&gt;The game is designed to run standalone or scale fluidly inside a compact &lt;code&gt;500x600&lt;/code&gt; Dev.to iframe embed.&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎮 Features&lt;/h2&gt;
&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;strong&gt;🃏 Witcher 3 Gwent scoring interface:&lt;/strong&gt; Circular neon row badges and large player/AI total score circles on the left, alongside pass indicator ribbons.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;📦 50 Unique ML-Themed Cards:&lt;/strong&gt; Build coding capacity with &lt;em&gt;SFT Code Snippets&lt;/em&gt;, deploy &lt;em&gt;Red-Team Jailbreak&lt;/em&gt; spies to draw cards, double parameters using &lt;em&gt;LoRA Adapters&lt;/em&gt;, or optimize weight adjustments using &lt;em&gt;DPO Tuning&lt;/em&gt; and &lt;em&gt;AdamW Optimizers&lt;/em&gt;.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;📉 Anomalous Drifts &amp;amp; Regularizers:&lt;/strong&gt; Navigate drifts like &lt;em&gt;Catastrophic Forgetting&lt;/em&gt; and &lt;em&gt;Exploding Gradients&lt;/em&gt; which collapse rows to Power 1, or regularize with &lt;em&gt;Gradient Clipping (Scorch)&lt;/em&gt; and &lt;em&gt;Model Pruning&lt;/em&gt;…&lt;/li&gt;

&lt;/ul&gt;&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/EPOCH-DUEL" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Vector Strike: Semantic Search Database Defender</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Tue, 07 Jul 2026 21:31:27 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/vector-strike-semantic-search-database-defender-4i87</link>
      <guid>https://dev.to/unitbuilds_cc/vector-strike-semantic-search-database-defender-4i87</guid>
      <description>&lt;p&gt;Have you ever wondered how vector databases like Pinecone, Milvus, Qdrant, or pgvector search through billions of high-dimensional documents in milliseconds? Under the hood, they map semantic concepts into dense numerical vectors, calculate multidimensional cosine similarity angles, and traverse proximity graphs to locate nearest neighbors without scanning the entire database.&lt;/p&gt;

&lt;p&gt;To help you visualize how vector databases and embeddings actually operate, I built a retro-vector arcade game:&lt;/p&gt;

&lt;h2&gt;
  
  
  🛰️ Vector Strike: Database Defender
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://vector-strike-90043718455.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://vector-strike-90043718455.us-central1.run.app" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Play in Fullscreen Mode (if the embed sizing is tight)&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Choose Your Database Optimizations
&lt;/h2&gt;

&lt;p&gt;Your mission as a Vector Database (VDB) administrator is to configure your query settings and index structures to defend your index nodes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;📏 Similarity Threshold (τ):&lt;/strong&gt; Tweak the match threshold slider. High thresholds require near-identical semantic matches but protect your index, whereas lower thresholds act like a splash-damage laser but risk matching incorrect clusters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🪐 Embedding Dimensions (2D $\rightarrow$ 8D $\rightarrow$ 32D):&lt;/strong&gt; Higher dimensions isolate categories and guarantee precise hits. Lowering dimensions collapses the projection space, causing spatial overlap that results in false deflections and friendly-fire query failures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;⚡ Proximity Indexing (Flat Scan $\rightarrow$ HNSW Graph):&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flat Scan:&lt;/strong&gt; Runs a brute-force linear search over all targets. It causes computation latency spikes as more query objects arrive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HNSW (Hierarchical Navigable Small World):&lt;/strong&gt; Dynamically builds proximity links between adjacent node targets. The turret traverses vectors along the nearest-neighbor graph, snap-locking onto targets with zero lookup latency.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;Here is how the arcade mechanics map to production vector databases:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🔀 Multidimensional Projections (Dimension collapse)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; You can toggle between 2D, 8D, and 32D space. In 32D space, the categories are cleanly separated. In 2D space, the database collapses, and you'll find space rockets getting deflected by vehicle lasers because they overlap on the collapsed axes.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  💾 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Embeddings map textual semantics into high-dimensional space (e.g., 1536 dimensions for OpenAI's &lt;code&gt;text-embedding-3-small&lt;/code&gt;). Reducing dimensionality (via PCA or projection) squeezes distinct concepts onto similar planes.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects VDBs
&lt;/h3&gt;

&lt;p&gt;When dimensions collapse, semantic resolution is lost. A vector database will begin returning false matches because unrelated words map to nearby coordinates on the truncated plane.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  2. 🛰️ Cosine Similarity Thresholds (The Match Laser)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; When you fire a category query (like &lt;code&gt;FOOD&lt;/code&gt; or &lt;code&gt;SPACE&lt;/code&gt;), the laser calculates the similarity value against targets it intersects. If the dot product similarity is below $\tau$, the laser deflects.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🗜️ The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Cosine similarity measures the cosine of the angle between two multi-dimensional vectors. It is a scale-invariant metric commonly used to check how close two documents are in embedding space.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects VDBs
&lt;/h3&gt;

&lt;p&gt;Production search pipelines filter results based on a minimum similarity score threshold. Setting the threshold too high returns zero results, while setting it too low returns irrelevant noise.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  3. 🕸️ HNSW Graph Traversals (Nearest-Neighbor Search)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; In HNSW mode, you see thin green link lines draw between targets. Firing the laser instantly traces a route along the lines, hopping from node to node to hit the target instantly rather than flying through the screen linearly.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🔋 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;HNSW (Hierarchical Navigable Small World) structures vectors into multi-layer proximity graphs. Instead of comparing the query vector against every single vector in the database, the search navigates the graph towards the closest neighbors.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🚀 How it affects VDBs
&lt;/h3&gt;

&lt;p&gt;By avoiding exhaustive linear scanning, HNSW slashes search latency from $O(N)$ to logarithmic time, allowing databases to query millions of records in microseconds.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  🛠️ The Under-the-Hood Engineering Journey
&lt;/h2&gt;

&lt;p&gt;Creating a vector-math arcade game presented some unique engineering tasks:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Simulating Dimensionality Collapse in JS
&lt;/h3&gt;

&lt;p&gt;To let players experience "Dimensional Collapse" in real-time, we precompute a 32-dimensional coordinate matrix for all words. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; When the player changes the dimension setting, the engine dynamically slices the vector coordinates &lt;code&gt;vec.slice(0, activeDim)&lt;/code&gt; and normalizes the sliced vectors before running the dot product:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getSlicedSimilarity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vecA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;vecB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dims&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;vecA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dims&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;vecB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dims&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;dot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;magA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;magB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;dims&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;dot&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="nx"&gt;magA&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="nx"&gt;magB&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;magA&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;magB&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;dot&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;magA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;magB&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. High-Performance HNSW Traversal Visualization
&lt;/h3&gt;

&lt;p&gt;To visualize greedy graph routing on canvas, we calculate proximity paths dynamically using a distance heap. When HNSW mode is active, the laser tracks the step-by-step hops along target coordinates, firing audio triggers at each step.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  Click to see the Greedy HNSW Traversal path generation
  &lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateHNSWPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;startX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

    &lt;span class="c1"&gt;// Find closest target to shooter (entry point)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;entryNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;minDist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;startX&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;entryNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startY&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;entryNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;startX&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startY&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;minDist&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;minDist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;entryNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;entryNode&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;entryNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;visited&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

    &lt;span class="c1"&gt;// Greedy routing towards targetNode along links&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// Find links from current node&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;links&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;hnswLinks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;nextNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;bestDist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nx"&gt;links&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;neighbor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;curr&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;visited&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;neighbor&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;neighbor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;neighbor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;bestDist&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;bestDist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                    &lt;span class="nx"&gt;nextNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;neighbor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextNode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;nextNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;visited&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// Jump directly if stuck&lt;/span&gt;
            &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targetNode&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What is your high score defending the Vector Database?&lt;/li&gt;
&lt;li&gt;Did you notice how 2D mode causes spaceships and rockets to deflect matching vectors due to axis collapse?&lt;/li&gt;
&lt;li&gt;Which index type did you find more visually pleasing: Flat or HNSW traversal paths?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/VECTOR-STRIKE" rel="noopener noreferrer"&gt;
        VECTOR-STRIKE
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Asteroids inspired game to teach players about Graph DBs for LLMs
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🛰️ Vector Strike: Semantic Search Database Defender&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;An educational retro-oscilloscope vector graphics game that maps database defense mechanics directly to vector embeddings, cosine similarity thresholds, and vector graph index traversal (Flat Scan vs. HNSW Graph Routing).&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://vector-strike-90043718455.us-central1.run.app/" rel="nofollow noopener noreferrer"&gt;Play the Live Demo here!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎮 The Concept&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;In &lt;strong&gt;Vector Strike&lt;/strong&gt;, you play as a Vector Database administrator defending your vector database partitions against incoming query concepts (represented by descending labeled target clusters).&lt;/p&gt;

&lt;p&gt;To eliminate targets, you press keys &lt;code&gt;1&lt;/code&gt;-&lt;code&gt;5&lt;/code&gt; to instantly fire the matching category laser and match target embeddings using &lt;strong&gt;Cosine Similarity&lt;/strong&gt;:&lt;/p&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;strong&gt;Embedding Accuracy:&lt;/strong&gt; Toggle dimensionality (2D, 8D, 32D). Lower dimensions (2D) collapse projection spaces and travel &lt;strong&gt;super fast&lt;/strong&gt;, but cause spatial collisions and false deflections. Higher dimensions (32D) travel &lt;strong&gt;slower&lt;/strong&gt;, but accurately filter complex overlap concepts.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Match Tolerance (τ):&lt;/strong&gt; Adjust your matching threshold slider. Tighten it for score multipliers on exact matches, or loosen…&lt;/li&gt;

&lt;/ul&gt;&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/VECTOR-STRIKE" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>PagedAttention: Navigating VRAM Fragmentation</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Mon, 06 Jul 2026 13:19:41 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/pagedattention-navigating-vram-fragmentation-3521</link>
      <guid>https://dev.to/unitbuilds_cc/pagedattention-navigating-vram-fragmentation-3521</guid>
      <description>&lt;p&gt;Have you ever wondered how high-performance LLM deployment frameworks like vLLM, TensorRT-LLM, or Hugging Face TGI actually optimize model serving? While you wait for tokens to stream into your chat window, the infrastructure under the hood is executing a fragile balancing act: scheduling prompt pre-computation, paging memory segments, verifying speculative token chains, and dodging system-stalling bottleneck crashes.&lt;/p&gt;

&lt;p&gt;To teach you how LLMs manage GPU memory under high concurrent loads, I built an interactive Tetris-style puzzle game:&lt;/p&gt;

&lt;h2&gt;
  
  
  🧱 PagedAttention: VRAM Tetris
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://paged-attention-166926259124.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://paged-attention-166926259124.us-central1.run.app" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Play in Fullscreen Mode (if the embed sizing is tight)&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Choose Your Allocation Mode
&lt;/h2&gt;

&lt;p&gt;Your journey as a memory scheduler is split into two distinct memory allocation modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🏢 Contiguous Mode (Easy/Vanilla):&lt;/strong&gt; Stacking falling token sequence blocks (Tetrominos) into solid rows. Any gaps you leave behind are trapped, creating unusable &lt;strong&gt;External Memory Fragmentation&lt;/strong&gt; that blocks new incoming allocations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔋 Paged Mode (PagedAttention - Hard):&lt;/strong&gt; Play with paged virtualization. Pressing &lt;strong&gt;Shift or P&lt;/strong&gt; triggers a &lt;strong&gt;Page Split&lt;/strong&gt;, shattering the active falling block into individual 1x1 memory pages that cascade down independently to fill any available fragmentation holes below.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;This isn't just standard Tetris—every shape, block placement, and allocation rule represents a real-world concept in modern machine learning infrastructure. Here is how the in-game mechanics map directly to how large language models allocate GPU memory:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 💾 Memory Allocation &amp;amp; Contiguity (Standard Stacking)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; You must rotate and slide falling token block shapes to pack them together contiguously. Complete horizontal rows of memory blocks represent completed inference requests, which are garbage-collected to free up VRAM.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  💾 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;In standard serving systems, key-value representations (KV-Cache) of a sequence are allocated in a contiguous physical VRAM buffer.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;Because the system doesn't know in advance how many tokens a query will generate, it must pre-allocate a contiguous space equal to the maximum sequence length. This pre-allocation locks up massive amounts of memory that may never be used, restricting concurrency.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  2. 🗜️ External Memory Fragmentation (The Stacking Gaps)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; Leaving empty spaces under your placed blocks represents external fragmentation. If VRAM fill spikes or blocks stack to the top, the engine crashes, throwing a &lt;strong&gt;CUDA OUT OF MEMORY (OOM)&lt;/strong&gt; error.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🗜️ The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Over time, as different requests finish at different times, the physical VRAM becomes cluttered with small, non-contiguous "gaps" of unallocated memory.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  ⚠️ How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;Even if you have 10 GB of total free VRAM, if it is split into 100 scattered megabyte-sized gaps, a new incoming request requiring a contiguous 1 GB block will fail—triggering a CUDA OOM crash because the allocator cannot defragment VRAM dynamically.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  3. 🔋 PagedAttention Virtualization (The Page Split)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; In Paged Mode, triggering a &lt;strong&gt;Page Split&lt;/strong&gt; shatters the falling shape into individual 1x1 blocks that automatically drop down to seek out and fill the smallest hidden gaps in the memory grid.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🔋 The Real-World Counterpart
&lt;/h3&gt;

&lt;p&gt;Inspired by operating system virtual memory paging, &lt;strong&gt;PagedAttention&lt;/strong&gt; (pioneered by vLLM) partitions the KV-cache of active sequences into logical blocks mapped to virtual tables.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  🚀 How it affects LLMs
&lt;/h3&gt;

&lt;p&gt;By breaking the requirement of physical contiguity, the engine can write incoming token keys and values into any free physical slots on the graphics card, no matter how scattered. This eliminates 96% of memory waste, allowing up to 4x higher serving concurrency on the same hardware.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  🛠️ The Under-the-Hood Engineering Journey
&lt;/h2&gt;

&lt;p&gt;Creating an educational puzzle game designed for embedded platforms presented some fascinating web development challenges:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Optimizing for the 600px Embed Limit
&lt;/h3&gt;

&lt;p&gt;Dev.to embeds are capped at a strict &lt;strong&gt;maximum height of 600px&lt;/strong&gt;. Fitting a complex tycoon dashboard with side panels, scoreboards, next-piece canvases, and a 20-row Tetris grid inside 600px required serious spatial compression.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; We shrank the cell block size (&lt;code&gt;BLOCK_SIZE&lt;/code&gt;) to &lt;strong&gt;22px&lt;/strong&gt; (yielding a 440px canvas height), converted the left panel stats list into a compact &lt;strong&gt;2x2 grid&lt;/strong&gt;, resized preview boxes to &lt;strong&gt;70px&lt;/strong&gt;, and relocated the system logs console from a horizontal footer directly into the left sidebar. The final layout fits completely inside exactly &lt;strong&gt;580px&lt;/strong&gt;, preventing vertical clipping.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Physics of the Paged Cascading Split
&lt;/h3&gt;

&lt;p&gt;Splitting a rigid grid structure into individual falling particles in real-time required careful synchronization.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; When the split is triggered, the engine parses the active Tetromino shape, decomposes it into coordinate objects relative to the grid columns, calculates the lowest-available free cell index per column, and translates each block to its destination slot before recalculating line-clear sweeps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;
  Click to see the Page Split Javascript logic
  &lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// --- Special Mechanic: Paged Memory Split ---&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;executePageSplit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;abilityCharge&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;addSystemLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PagedAttention Split not fully charged yet!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;warning&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;SOUNDS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;SOUNDS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;addSystemLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Executing PagedAttention: Splitting &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; into virtual pages...`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;info&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Get all filled cells of the falling piece&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                    &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;currentPiece&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Drop each page individually down its column to the lowest free cell&lt;/span&gt;
    &lt;span class="nx"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lowestY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lowestY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;ROWS&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;lowestY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;lowestY&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lowestY&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;lowestY&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;abilityCharge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Consume charge&lt;/span&gt;
    &lt;span class="nf"&gt;clearMemoryLines&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;spawnPiece&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What is your high score in Paged Mode utilizing the Page Split ability?&lt;/li&gt;
&lt;li&gt;Did you notice how quickly a contiguous stack triggers a CUDA OOM compared to a paged system?&lt;/li&gt;
&lt;li&gt;How does VRAM Tetris change your perspective on memory allocation bottlenecks?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/PAGED-ATTENTION" rel="noopener noreferrer"&gt;
        PAGED-ATTENTION
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Tetris inspired game to teach how LLMs use VRAM
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🧱 PagedAttention: VRAM Memory Allocation Tetris&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An educational retro-cyberpunk Tetris-style simulator that maps classic block-packing gameplay directly to GPU memory allocation, external memory fragmentation, and virtual paging concepts.&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://paged-attention-166926259124.us-central1.run.app/" rel="nofollow noopener noreferrer"&gt;Play the Live Demo here!&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;(Will be updated after deploy)&lt;/em&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎮 The Concept&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;In &lt;strong&gt;PagedAttention Tetris&lt;/strong&gt;, you play as a GPU memory scheduler. Incoming requests of varying token sizes (represented by falling Tetris shapes) must be allocated in the GPU's memory registers. Gaps left behind represent &lt;strong&gt;External Memory Fragmentation&lt;/strong&gt;. If memory becomes too cluttered and blocks stack to the top, you trigger a &lt;strong&gt;CUDA Out of Memory (OOM)&lt;/strong&gt; crash.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Playable Memory Allocation Engines:&lt;/h3&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;🏢 &lt;strong&gt;Contiguous Mode:&lt;/strong&gt; Falling block sequences remain solid. If gaps are left underneath, they cannot be filled, causing fragmentation and system bloat.&lt;/li&gt;
&lt;li&gt;🔋 &lt;strong&gt;Paged Mode (PagedAttention):&lt;/strong&gt; Pressing &lt;code&gt;Shift&lt;/code&gt; or &lt;code&gt;P&lt;/code&gt; triggers a &lt;strong&gt;Page Split&lt;/strong&gt;. The active falling block shatters into individual 1x1 block pages that…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/PAGED-ATTENTION" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Token Factory: Understanding the pipeline</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Sun, 05 Jul 2026 19:24:11 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/token-factory-understanding-the-pipeline-1fcg</link>
      <guid>https://dev.to/unitbuilds_cc/token-factory-understanding-the-pipeline-1fcg</guid>
      <description>&lt;p&gt;Have you ever wondered how high-performance LLM deployment frameworks like vLLM, TensorRT-LLM, or Hugging Face TGI actually optimize model serving? While you wait for tokens to stream into your chat window, the infrastructure under the hood is executing a fragile balancing act: scheduling prompt pre-computation, paging memory segments, verifying speculative token chains, and dodging system-stalling bottleneck crashes.&lt;/p&gt;

&lt;p&gt;To teach you how LLMs are deployed, optimized, and served under high concurrent loads, I built an interactive factory simulation game:&lt;/p&gt;

&lt;h2&gt;
  
  
  🏭 Inference Pipeline Tycoon
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://llms-are-demented-166926259124.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://llms-are-demented-166926259124.us-central1.run.app/token-factory/" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Play in Fullscreen Mode (if the embed sizing is tight)&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Choose Your Terminal Level
&lt;/h2&gt;

&lt;p&gt;Your journey as an infrastructure architect is split into three distinct serving terminals, each introducing advanced optimizations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;⚡ Level 1: Prefill &amp;amp; Decode Basics (Easy):&lt;/strong&gt; Route prompts from the input queue into a Prefill Core to compute key-value activations, then link them to a Decode Core to generate autoregressive token streams. Target: &lt;strong&gt;30.0 TPS&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔋 Level 2: KV-Cache Paged Memory (Medium):&lt;/strong&gt; Process large context windows under tight VRAM constraints. You must connect virtual paging allocators to compress memory allocations and prevent CUDA Out-of-Memory crashes. Target: &lt;strong&gt;60.0 TPS&lt;/strong&gt; on a restricted &lt;strong&gt;3072 MB VRAM&lt;/strong&gt; card.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🚀 Level 3: Speculative Speedup (Hard):&lt;/strong&gt; Autoregressive decode is too slow to hit the client quota. You must deploy lightweight draft models and validation gates to generate and verify 3 tokens in parallel per step. Target: &lt;strong&gt;120.0 TPS&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;This isn't just a basic puzzle game—every component, routing direction, and memory rule represents a real-world concept in modern machine learning infrastructure. Here is how the in-game mechanics map directly to how large language models are optimized and served in production:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🎯 Prefill vs. Decode (The Sequential Pipeline)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; You must place a &lt;strong&gt;Prefill Core (PREF)&lt;/strong&gt; to process green prompt packets into magenta activation vectors, then route them to a &lt;strong&gt;Decode Core (DECO)&lt;/strong&gt; to begin autoregressive sequence token generation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; LLM serving divides inference into two phases:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefill:&lt;/strong&gt; Processes the user's prompt tokens in parallel, generating the initial Key-Value (KV) attention matrices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decode:&lt;/strong&gt; Generates one token at a time sequentially. It takes the newly generated token and appends it to the history, running a full forward pass of the model &lt;em&gt;per token&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Because decode is bound by memory bandwidth (requiring reloading billions of model weights for every single token predicted), it is much slower than prefill. Placing cores far apart adds routing latency. Clumping them together represents standard hardware co-location to maximize throughput.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. 🔋 KV-Cache Paging (vLLM Page Allocator)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; Placing &lt;strong&gt;Page Allocators (vLLM)&lt;/strong&gt; immediately adjacent to Prefill and Decode cores automatically compresses their VRAM cache footprint by &lt;strong&gt;40%&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Key-Value caching saves past token representations in GPU VRAM so they don't have to be recalculated. However, dynamic user prompt sizes cause severe memory fragmentation, leading to premature allocation limits and &lt;code&gt;CUDA Out of Memory&lt;/code&gt; failures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Modern engines implement &lt;strong&gt;PagedAttention&lt;/strong&gt; (popularized by vLLM). By allocating virtual memory tables and partitioning the KV-cache into logical pages (similar to operating system paging), engines eliminate fragmentation and cache waste, multiplying GPU serving capacity by up to 4x.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. 🚀 Speculative Decoding (Drafter &amp;amp; Validation Gates)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Game:&lt;/strong&gt; Placing a &lt;strong&gt;Draft Model (DRAF)&lt;/strong&gt; adjacent to a Decode Core allows it to generate a draft of &lt;strong&gt;3 speculative tokens&lt;/strong&gt; per step. These drafts must pass through a &lt;strong&gt;Validation Gate (VALI)&lt;/strong&gt; to verify them before reaching the output sink.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Speculative decoding pairs a massive, accurate target LLM with a tiny, lightweight draft model that runs extremely fast. The draft model speculatively generates a sequence of $K$ tokens. The target model then verifies all $K$ tokens in parallel in a single forward pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Since the target model can verify multiple tokens in the same amount of time it takes to generate one token autoregressively, speculative decoding dramatically reduces latency. If the draft matches, we gain $K$ tokens in a single step; if it misses, we roll back and regenerate.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ The Under-the-Hood Engineering Journey
&lt;/h2&gt;

&lt;p&gt;Building a high-throughput simulation game with canvas rendering and real-time audio synthesis presented some fascinating web development challenges:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Fixed Timestep Physics (Decoupling FPS from TPS)
&lt;/h3&gt;

&lt;p&gt;When rendering hundreds of active token particles simultaneously, canvas draw overhead can drop the browser's render rate to 15–20 FPS on older devices. In early drafts, this slowed down the clock, capping the throughput at 66 TPS even with optimized pipelines. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; We implemented a &lt;strong&gt;Fixed Timestep Accumulator&lt;/strong&gt; (60 ticks/sec). Even if the browser's rendering frame rate lags, the accumulator catches up by running multiple simulation ticks per frame, keeping the throughput (TPS) metrics completely accurate to real wall-clock time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Resolving Conduit Queue Propagation
&lt;/h3&gt;

&lt;p&gt;Conduits initially processed one packet per tile per tick. When Speculative validation released batches of 3 tokens at once, the conduits created queue pile-ups, capping throughput at a hard limit. Changing conduit propagation to a &lt;code&gt;while&lt;/code&gt; loop allowed wire tiles to behave like physical conductors, transferring all arrived tokens in the same frame.&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What was your highest throughput layout on Level 3?&lt;/li&gt;
&lt;li&gt;Did you manage to fit vLLM Page Allocators and Speculative Drafters cleanly on Level 3's grid without OOM?&lt;/li&gt;
&lt;li&gt;What architectural combination did you find most effective?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/LLMs-are-Demented" rel="noopener noreferrer"&gt;
        LLMs-are-Demented
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An educational crossword game to learn about LLMs
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;📟 The Gating Crisis: Sparse MoE Router Simulator 🧠⚡&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Part of the UnitBuilds CC Playgrounds Suite&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/UnitBuilds-CC/LLMs-are-Demented#" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/d11cc67068093b89bb87906da8b5fc96ab5df7203a574e2881425924c79910fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4172636869746563747572652d5370617273652532304d6f4525323028546f702d2d32292d627269676874677265656e2e737667" alt="Architecture: Sparse MoE"&gt;&lt;/a&gt;
&lt;a href="https://github.com/UnitBuilds-CC/LLMs-are-Demented#" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/3c78eafd72b3108350eac6dee395a41a1fa2c2b9f822d46f6a4e7acc649a3dd3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4465706c6f796d656e742d436c6f756425323052756e2d626c75652e737667" alt="Deployment: Cloud%20Run"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Welcome, neural engineer. You have been put in charge of the &lt;strong&gt;Gating Network (Router)&lt;/strong&gt; for a running Mixture of Experts (MoE) Large Language Model.&lt;/p&gt;
&lt;p&gt;Your task is to route incoming multi-modal token streams (&lt;code&gt;[T] Text&lt;/code&gt;, &lt;code&gt;[M] Math&lt;/code&gt;, &lt;code&gt;[V] Vision&lt;/code&gt;, &lt;code&gt;[A] Audio&lt;/code&gt;, and &lt;code&gt;[C] Code&lt;/code&gt;) to specialized Feed-Forward Network (FFN) experts in real-time. Since this is a &lt;strong&gt;Top-2 Routing&lt;/strong&gt; network, you must dispatch every token to exactly &lt;strong&gt;two experts&lt;/strong&gt; before it reaches the eviction threshold.&lt;/p&gt;
&lt;p&gt;If you route tokens incorrectly, the model's output quality degrades into &lt;strong&gt;perplexity collapse&lt;/strong&gt;. If you overload any individual expert beyond its queue limit, the system experiences &lt;strong&gt;Capacity Drops&lt;/strong&gt; (loss of data).&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🕹️ Game Mechanics (How to Play)&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;⌨️ Hotkey Routing:&lt;/strong&gt; Use numbers &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;8&lt;/code&gt; (or &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;4&lt;/code&gt; in simplified mode) to…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/LLMs-are-Demented" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>GPU Survivors: Can You Survive a 1T Parameter Inference Run?</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Sat, 04 Jul 2026 11:04:36 +0000</pubDate>
      <link>https://dev.to/unitbuilds_cc/gpu-survivors-can-you-survive-a-1t-parameter-inference-run-476d</link>
      <guid>https://dev.to/unitbuilds_cc/gpu-survivors-can-you-survive-a-1t-parameter-inference-run-476d</guid>
      <description>&lt;p&gt;Ever wondered what a GPU goes through during a massive language model inference run? While you type a query and wait for tokens, the silicon under the hood is holding together a fragile house of cards: balancing context window limits, scheduling activations, managing weights, and evading malicious adversarial attacks.&lt;/p&gt;

&lt;p&gt;To teach you how LLMs behave (and fall apart) under load, I built an interactive game:&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡ GPU Survivors: Latent Space Hell
&lt;/h2&gt;


&lt;div class="ltag__cloud-run"&gt;
  &lt;iframe height="600px" src="https://llms-are-demented-166926259124.us-central1.run.app"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://llms-are-demented-166926259124.us-central1.run.app/gpu-survivors/" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Play in Fullscreen Mode (if the embed sizing is tight)&lt;/a&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Choose Your Hardware Preset
&lt;/h2&gt;

&lt;p&gt;Before initiating your run, choose your difficulty configuration (each represented by a unique retro pixel chip sprite and custom parameters):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;🏢 Enterprise API (Easy):&lt;/strong&gt; Spawns with 6 Core Integrity Lives, fast speed (&lt;code&gt;2.8&lt;/code&gt;), boosted damage, and a wide collection window. You get &lt;code&gt;+25%&lt;/code&gt; XP gains and start with both the Attention Beam and the Softmax Aura active.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;💻 Consumer GPU (Medium):&lt;/strong&gt; Spawns with 5 Core Lives, normal speed (&lt;code&gt;2.5&lt;/code&gt;), standard damage, and standard &lt;code&gt;100%&lt;/code&gt; XP gains. Starts with the Attention Beam active.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;🍞 Smart Toaster (Hard):&lt;/strong&gt; Edge inference on a kitchen appliance. Spawns with only 4 Core Lives, slow speed (&lt;code&gt;2.1&lt;/code&gt;), reduced damage, and a &lt;code&gt;-20%&lt;/code&gt; XP penalty. Starts with a single Attention head active.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 Playable ML Concepts Explained
&lt;/h2&gt;

&lt;p&gt;This isn't just a homage to Vampire Survivors—every upgrade, weapon, and enemy represents a real-world concept in modern machine learning. Here is how the in-game mechanics map directly to how Large Language Models operate, fail, and optimize in production:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🎯 Cosine Similarity (Piercing Vector Arrows)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; Fires piercing vector arrows in a fan. Moving in the direction of the fire boosts damage by &lt;strong&gt;+60%&lt;/strong&gt; (aligned vectors), while moving backward deals standard damage.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Text token embeddings are high-dimensional vectors. Cosine similarity calculates the cosine of the angle between two vectors to determine their semantic closeness:
$$\text{Similarity} = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{A}| |\mathbf{B}|}$$&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; This is the mathematical core behind &lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt;, semantic database search, and &lt;strong&gt;Self-Attention&lt;/strong&gt; mechanisms. When the user prompt query vector aligns closely with a key vector in the model, the dot product spikes—assigning a massive attention score to pull that context forward.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. 🗜️ Quantization (Passive Cooldown Upgrade)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; Increases weapon firing rate (cooldown speed) at the cost of slightly lower base damage.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Quantization converts model weights and activation outputs from high-precision floating-point formats (like FP32 or FP16) to lower-precision integers (like INT8 or INT4).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Scaling massive models requires optimization. Quantization drastically reduces VRAM requirements, allowing a 70B parameter model that normally requires enterprise GPUs to run on local laptops. However, rounding values to a coarser scale introduces quantization noise, which slightly degrades the model's perplexity (leading to minor performance loss or "damage").&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. 🧬 Weight Decay (Hitbox Shrinking)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; L2 regularization reduces the physical size of the player's core hitbox, making it harder for incoming token anomalies to land a hit.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; L2 regularization penalizes large weights by adding a fraction of the squared magnitudes to the training loss function:
$$L_{\text{regularized}} = L_{\text{base}} + \lambda \sum_{i} w_i^2$$&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; During pre-training, weight decay restrains model weights from growing too large. Keeping weights bounded makes the model less sensitive to minor noise in the user prompt, improving generalization and reducing hallucinations. The resulting "smaller footprint of instability" translates directly in-game to a smaller, more regularized core hitbox.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. 🧬 Node Dropout (Ignore Hit Check)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; Grants a flat &lt;strong&gt;+8%&lt;/strong&gt; chance per level to completely ignore or evade incoming damage.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Dropout is a regularization technique where a random percentage of neural nodes (activations) are zeroed out at each training step.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; By shutting down random neural pathways during training, the model is forced to learn redundant, robust representations rather than relying on a single, fragile sequence of nodes. This prevents the model from overfitting to its training dataset, allowing it to adapt cleanly to unseen prompt distributions at inference time (represented in-game by dropping nodes to safely "evade" bad data).&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. 🔒 Adversarial Split (Jailbreaks)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; High-health golden locks. When destroyed, they split into &lt;strong&gt;3 fast-moving Adversarial Tokens&lt;/strong&gt; that lock onto the player.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; A jailbreak is a targeted input sequence designed to bypass the safety alignments (RLHF/DPO) of a model, prompting it to output restricted content.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Jailbreaks exploit the fact that LLMs treat data and instructions identically. Once a malicious prompt slips past the model's safety guardrails, it triggers an autoregressive cascade of toxic outputs. In-game, this is represented by the sudden explosion of fast-moving adversarial tokens that quickly clutter your active context window.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. ⚖️ The Horizontal Data Bias (Skewing Fields)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; Stepping inside the green Data Bias radius skews your movement coordinate vectors, dragging you in the direction the arrow points.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; Data bias occurs when training corpora contain unbalanced representations, stereotypes, or uneven historical distributions.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; LLMs reflect their training datasets. If the data is biased, the output token probability distribution is heavily skewed toward those prejudices. For example, if a model's training data repeatedly associates a profession with a specific demographic, it will struggle to generate neutral completions. This creates a constant, invisible drift that biases output completions, directly mirroring the in-game dragging force.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. 💾 KV-Cache (The Protective Orbitals)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;In-Game:&lt;/strong&gt; Key-Value caching blocks rotate around the core, absorbing hits.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Real-World Counterpart:&lt;/strong&gt; The KV-Cache saves the key-value representations of past tokens in GPU VRAM so they don't have to be recalculated at every token prediction step.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;How it affects LLMs:&lt;/strong&gt; Auto-regressive generation predicts one word at a time, feeding its own output back as input. Without a KV-cache, the model would have to compute attention scores across the entire history for &lt;em&gt;every single token generated&lt;/em&gt;, causing latency to scale quadratically. The KV-cache saves computation but consumes huge amounts of memory, restricting user concurrency.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💀 The 15-Minute Thermal Runaway (Endgame)
&lt;/h2&gt;

&lt;p&gt;At exactly &lt;strong&gt;15:00&lt;/strong&gt;, all standard enemies are swept away, and the unkillable red boss &lt;strong&gt;Hardware Degradation&lt;/strong&gt; arrives. You cannot harm it.&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 Let's Discuss:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What was your longest survival time on Smart Toaster difficulty?&lt;/li&gt;
&lt;li&gt;What architectural combination (e.g., Quantization speed boosts + Cosine Similarity) did you find most effective?&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/UnitBuilds-CC" rel="noopener noreferrer"&gt;
        UnitBuilds-CC
      &lt;/a&gt; / &lt;a href="https://github.com/UnitBuilds-CC/GPU-SURVIVORS" rel="noopener noreferrer"&gt;
        GPU-SURVIVORS
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Homage to Vampire Survivors, as an educational game to teach players about LLMs.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;GPU Survivors: Latent Space Hell 📟⚡&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Can you survive a 1T parameter inference run?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Welcome to &lt;strong&gt;GPU Survivors&lt;/strong&gt;, an interactive 2D retro action-roguelike built to simulate the architectural limits, failure modes, and optimization hyperparameters of running a Large Language Model under load.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎮 The Scenario&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;In the digital deep, bad data and chaotic vectors threaten inference stability. You are a &lt;strong&gt;GPU Core&lt;/strong&gt; initializing a new language model. Survive the endless incoming waves of training loads (OOD outliers, prompt injections, and data biases), gather &lt;strong&gt;FLOPs (XP)&lt;/strong&gt;, and scale your architecture to &lt;strong&gt;1T parameters&lt;/strong&gt;!&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;⌨️ Controls&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Move:&lt;/strong&gt; Use &lt;code&gt;WASD&lt;/code&gt; or &lt;code&gt;Arrow Keys&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pause:&lt;/strong&gt; Press &lt;code&gt;Escape&lt;/code&gt; or &lt;code&gt;P&lt;/code&gt; to pause the run, resume, or exit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attack:&lt;/strong&gt; Auto-targeted active weapons fire queries at the nearest token anomalies.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🛠️ Hardware Presets (Difficulty Modes)&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Select your inference endpoint difficulty at startup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🏢 ENTERPRISE API (H100 Cluster) — Easy&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Stats:&lt;/em&gt; 6 Core Integrity…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/UnitBuilds-CC/GPU-SURVIVORS" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>games</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>To anyone who enjoyed the games series, tomorrow is gunna be a fun 1. Anyone like Vampire Survivor? (Hint)</title>
      <dc:creator>UnitBuilds</dc:creator>
      <pubDate>Fri, 03 Jul 2026 21:46:54 +0000</pubDate>
      <link>https://dev.to/unitbuilds/to-anyone-who-enjoyed-the-games-series-tomorrow-is-gunna-be-a-fun-1-anyone-like-vampire-survivor-3o88</link>
      <guid>https://dev.to/unitbuilds/to-anyone-who-enjoyed-the-games-series-tomorrow-is-gunna-be-a-fun-1-anyone-like-vampire-survivor-3o88</guid>
      <description></description>
    </item>
  </channel>
</rss>
