<?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: Yury Gagarin</title>
    <description>The latest articles on DEV Community by Yury Gagarin (@yury_gagarin_b26c9247af7c).</description>
    <link>https://dev.to/yury_gagarin_b26c9247af7c</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%2F3647907%2F96d9242b-891b-46ff-bc02-c378feaa3662.png</url>
      <title>DEV Community: Yury Gagarin</title>
      <link>https://dev.to/yury_gagarin_b26c9247af7c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yury_gagarin_b26c9247af7c"/>
    <language>en</language>
    <item>
      <title>Nintendo 3DS in a Browser: Two Days of AI-Assisted Porting, Then the Hard Parts</title>
      <dc:creator>Yury Gagarin</dc:creator>
      <pubDate>Sun, 18 Oct 2026 07:50:56 +0000</pubDate>
      <link>https://dev.to/yury_gagarin_b26c9247af7c/nintendo-3ds-in-a-browser-two-days-of-ai-assisted-porting-then-the-hard-parts-3ai2</link>
      <guid>https://dev.to/yury_gagarin_b26c9247af7c/nintendo-3ds-in-a-browser-two-days-of-ai-assisted-porting-then-the-hard-parts-3ai2</guid>
      <description>&lt;p&gt;&lt;em&gt;Cover: AI-generated concept illustration of a hypothetical foldable phone, not a photograph of existing hardware or a screenshot of the emulator.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It started with the idea of a dual-screen iPhone. That form factor seems almost made for Nintendo DS and 3DS games: the main display above, the touchscreen below.&lt;/p&gt;

&lt;p&gt;But before thinking about a finished app, I wanted to answer a smaller question: could a 3DS emulator run on an iPhone at a useful speed?&lt;/p&gt;

&lt;p&gt;For this experiment, I couldn't rely on giving an ordinary iOS app its own JIT entitlement. So I tried another route: recompile guest ARM code to WebAssembly at runtime, then let the browser engine compile that.&lt;/p&gt;

&lt;p&gt;After two days, I had an experimental Panda3DS port running Super Mario 3D Land in a browser. On a Mac, it reached full emulation speed. On an iPhone, things got more interesting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI disclosure:&lt;/strong&gt; AI wrote most of the new port code. I directed the work, ran builds, tested on devices, and helped investigate failures. This article was also prepared and translated with AI assistance. The emulator foundation is Panda3DS, and the CPU recompiler foundation is Dynarmic, built by their respective developers. These two days produced a port of that existing work, not a 3DS emulator from scratch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/gagarinyury/panda3ds-wasm" rel="noopener noreferrer"&gt;Source on GitHub&lt;/a&gt; · &lt;a href="https://panda.profy.top/" rel="noopener noreferrer"&gt;Try the browser demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What works today
&lt;/h2&gt;

&lt;p&gt;In Chrome on an Apple Silicon Mac, Super Mario 3D Land and Mario Kart 7 run at 60 fps emulation speed in the tested scenes. Sound, keyboard input, and on-screen controls work.&lt;/p&gt;

&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%2Fqofly133i23xu1cdsmmh.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%2Fqofly133i23xu1cdsmmh.png" alt="Super Mario 3D Land running in the actual browser player" width="799" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Actual player screenshot: Super Mario 3D Land on an M-series Mac. This is separate from the imagined hardware in the cover.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Everything runs locally. The server serves the page and emulator; users open their own game dumps. There is no streaming or server-side emulation, and no commercial game data is hosted.&lt;/p&gt;

&lt;p&gt;On iPhone, menus and light scenes in Mario 3D Land run at roughly 55–63 fps. The heavy World 1-1 scene only reaches 16–22 fps.&lt;/p&gt;

&lt;p&gt;This is still an experiment. Compatibility varies, compiling new shaders can cause noticeable pauses, and some games do not get past startup. Full save states are not implemented, although game-save persistence is available.&lt;/p&gt;

&lt;p&gt;You can try the site without a commercial game: it includes free homebrew graphics examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  How ARM code reaches the browser
&lt;/h2&gt;

&lt;p&gt;Panda3DS uses Dynarmic for dynamic CPU recompilation. The port adds a backend that translates Dynarmic's intermediate representation into WebAssembly.&lt;/p&gt;

&lt;p&gt;The path is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guest ARM → Dynarmic IR → WebAssembly → machine code compiled by the browser engine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PICA graphics are rendered through WebGL2.&lt;/p&gt;

&lt;p&gt;On iPhone, this runs inside WKWebView without the application receiving its own JIT entitlement: WebKit performs the WebAssembly compilation.&lt;/p&gt;

&lt;p&gt;The architecture sounds straightforward. Getting a picture on screen was only the beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Surprise #1: headless testing hid a graphics bottleneck
&lt;/h2&gt;

&lt;p&gt;One scene was bottlenecked by graphics buffer uploads.&lt;/p&gt;

&lt;p&gt;In a visible Chrome window on ANGLE/Metal, the existing streaming-buffer path using glBufferSubData took approximately 30–40 microseconds per call. At more than 500 calls per frame, that becomes a substantial part of the frame budget.&lt;/p&gt;

&lt;p&gt;Switching to buffer orphaning with glBufferData reduced the upload cost. In one measured scene, emulation speed went from 15–22 to 60 fps.&lt;/p&gt;

&lt;p&gt;The awkward part: headless Chrome did not expose the same bottleneck.&lt;/p&gt;

&lt;p&gt;For this project, the lesson was practical: automated runs help, but I also need to measure performance with the game actually visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Surprise #2: too many small WebAssembly instances
&lt;/h2&gt;

&lt;p&gt;Initially, each compiled guest block had its own WebAssembly instance.&lt;/p&gt;

&lt;p&gt;That worked at small scale. In Safari on the Mac, however, performance deteriorated as the number of live instances grew into the tens of thousands.&lt;/p&gt;

&lt;p&gt;There was another problem: importing many helper functions consumed executable memory in JavaScriptCore, eventually crashing the page.&lt;/p&gt;

&lt;p&gt;The changes were to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pack 256 compiled blocks into one instance.&lt;/li&gt;
&lt;li&gt;Call helpers indirectly through a shared table, reducing per-module imports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In one heavy Safari-on-Mac scenario, this brought performance from roughly 19 Hz to 44 Hz.&lt;/p&gt;

&lt;p&gt;These are measurements from this project, not a universal WebAssembly optimization recipe. On iPhone, the same changes did not fix the main slowdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  The unresolved iPhone problem
&lt;/h2&gt;

&lt;p&gt;The heavy scene runs at 16–22 Hz on the phone.&lt;/p&gt;

&lt;p&gt;Remove all draw calls, while keeping uploads and the rest of the emulator running, and it reaches approximately 59–63 Hz. That points toward the drawing path, but does not by itself distinguish GPU execution, command submission, and synchronization.&lt;/p&gt;

&lt;p&gt;To narrow it down, we recorded the WebGL calls for one frame and built a standalone replay page.&lt;/p&gt;

&lt;p&gt;The recording contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8,711 WebGL calls.&lt;/li&gt;
&lt;li&gt;345 draws: 343 TRIANGLES draws and two TRIANGLE_STRIP draws.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The standalone page replays that frame at approximately 59 Hz on the same phone, even with 9 ms of artificial CPU work added per frame.&lt;/p&gt;

&lt;p&gt;Adding a large WASM memory and tens of thousands of live WASM instances does not reproduce the real emulator's slowdown either.&lt;/p&gt;

&lt;p&gt;But the recording repeats a single frame. In the real game, texture contents change, render targets are sampled by later draws, and dependencies carry across frames. The replay may be missing an important part of that workload.&lt;/p&gt;

&lt;p&gt;The open question is: &lt;strong&gt;what needs to change in the replay to make it representative of the live emulator?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The replay is in web/probe-glreplay.html, with the recording in web/glframe.json. Detailed measurements and rejected experiments are documented in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  What two days actually produced
&lt;/h2&gt;

&lt;p&gt;A working browser prototype, with a new recompilation path, graphics, audio, and controls. It can already run games, but it has a long way to go before becoming a mature emulator.&lt;/p&gt;

&lt;p&gt;AI made it possible to attempt a volume of changes I would not otherwise have taken on at this pace. A substantial part of the work was verification: does the game boot, does it render correctly, what does a timing number actually measure, and did the latest change improve anything?&lt;/p&gt;

&lt;p&gt;The useful result is that the original idea can now be tested on real hardware. Instead of asking whether it is possible at all, I have a running port and specific problems to investigate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/gagarinyury/panda3ds-wasm" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://panda.profy.top/" rel="noopener noreferrer"&gt;Browser demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/gagarinyury/panda3ds-wasm/blob/main/docs/webkit-instances-and-batching.md" rel="noopener noreferrer"&gt;WebKit instances and batching notes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/gagarinyury/panda3ds-wasm/blob/main/docs/performance-notes.md" rel="noopener noreferrer"&gt;Graphics performance experiments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to the Panda3DS and Dynarmic developers for the foundations of this experiment. The project is GPL-3.0-or-later and is not affiliated with Nintendo or Apple.&lt;/p&gt;

&lt;p&gt;If you have profiled WebGL2 on iOS, or seen a similar gap between a captured-frame replay and a live application, I'd love to compare notes.&lt;/p&gt;

</description>
      <category>webassembly</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🔮 I Built an AI Code Fortune Teller with Kiro | Kiroween 2025</title>
      <dc:creator>Yury Gagarin</dc:creator>
      <pubDate>Fri, 05 Dec 2025 12:31:15 +0000</pubDate>
      <link>https://dev.to/yury_gagarin_b26c9247af7c/i-built-an-ai-code-fortune-teller-with-kiro-kiroween-2025-56j</link>
      <guid>https://dev.to/yury_gagarin_b26c9247af7c/i-built-an-ai-code-fortune-teller-with-kiro-kiroween-2025-56j</guid>
      <description>&lt;p&gt;# 🔮 Crystal Ball CI/CD - An AI Code Fortune Teller&lt;/p&gt;

&lt;p&gt;For Kiroween 2025, I built an AI-powered code review system&lt;br&gt;
  that predicts bugs before deployment - wrapped in a mystical&lt;br&gt;
   Halloween UI! 🎃&lt;/p&gt;

&lt;p&gt;## What It Does&lt;/p&gt;

&lt;p&gt;Crystal Ball analyzes GitHub Pull Requests using Claude 3.5&lt;br&gt;
  AI and broadcasts predictions to a real-time dashboard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Detects SQL injection, XSS, hardcoded secrets&lt;/li&gt;
&lt;li&gt;⚡ WebSocket real-time updates&lt;/li&gt;
&lt;li&gt;🎨 Mystical Halloween interface with animations&lt;/li&gt;
&lt;li&gt;📊 Color-coded scores: 🟢 ≥80, 🟡 60-79, 🔴 &amp;lt;60&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;## How Kiro Changed My Workflow&lt;/p&gt;

&lt;p&gt;### Spec-Driven Development&lt;br&gt;
  I wrote specs in &lt;code&gt;.kiro/specs/&lt;/code&gt; defining the architecture,&lt;br&gt;
  API contracts, and requirements. Kiro generated&lt;br&gt;
  production-ready code that just &lt;em&gt;worked&lt;/em&gt; - zero integration&lt;br&gt;
  bugs because contracts were defined upfront!&lt;/p&gt;

&lt;p&gt;### Vibe Coding for UI&lt;br&gt;
  The game-changer: I described what I wanted ("floating&lt;br&gt;
  crystal ball with mystical glow", "flying ghost animations")&lt;br&gt;
   and Kiro generated 500+ lines of perfect CSS with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Glass refraction gradients&lt;/li&gt;
&lt;li&gt;Rotating mist animations&lt;/li&gt;
&lt;li&gt;Random lightning strikes&lt;/li&gt;
&lt;li&gt;Individual ghost trajectories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What took days of CSS tweaking took &lt;em&gt;hours&lt;/em&gt; with vibe&lt;br&gt;
  coding.&lt;/p&gt;

&lt;p&gt;### The Combo&lt;br&gt;
  &lt;strong&gt;Specs for the plumbing, vibes for the polish.&lt;/strong&gt; Backend&lt;br&gt;
  logic needed precision - API contracts, security,&lt;br&gt;
  validation. UI needed feel - mystical glow, smooth easing,&lt;br&gt;
  ethereal effects. Kiro handled both seamlessly.&lt;/p&gt;

&lt;p&gt;## Tech Stack&lt;br&gt;
  Python | FastAPI | Claude API | React | WebSockets | GitHub&lt;br&gt;
  Webhooks&lt;/p&gt;

&lt;p&gt;## Try It&lt;br&gt;
  🔗 &lt;strong&gt;GitHub:&lt;/strong&gt;&lt;br&gt;
  &lt;a href="https://github.com/gagarinyury/crystal-ball-cicd-kiro" rel="noopener noreferrer"&gt;https://github.com/gagarinyury/crystal-ball-cicd-kiro&lt;/a&gt;&lt;br&gt;
  🌐 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="http://207.180.199.169:5175" rel="noopener noreferrer"&gt;http://207.180.199.169:5175&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.kiro/&lt;/code&gt; directory has all the specs - see spec-driven&lt;br&gt;
  development in action!&lt;/p&gt;

&lt;p&gt;## Key Takeaway&lt;br&gt;
  Kiro's vibe coding understood &lt;em&gt;intent&lt;/em&gt;. When I said "make it&lt;br&gt;
   feel mystical," it added pulsing glows, exponential easing,&lt;br&gt;
   and layered shadows I hadn't thought of. That aesthetic&lt;br&gt;
  understanding is powerful! ✨&lt;/p&gt;

&lt;p&gt;May the Crystal Ball reveal only good omens in your code! 🔮&lt;/p&gt;

&lt;p&gt;#kiro #kiroween #ai #codereview&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>api</category>
      <category>css</category>
    </item>
  </channel>
</rss>
