<?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>Forem: jack</title>
    <description>The latest articles on Forem by jack (@jackwind).</description>
    <link>https://forem.com/jackwind</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3652799%2F758f595c-6af2-496c-b1a5-9d700b3d24c9.jpg</url>
      <title>Forem: jack</title>
      <link>https://forem.com/jackwind</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jackwind"/>
    <language>en</language>
    <item>
      <title>Is 1000Hz possible in Chrome? Bypassing the Event Loop to test Mouse Polling Rate</title>
      <dc:creator>jack</dc:creator>
      <pubDate>Thu, 25 Dec 2025 02:01:48 +0000</pubDate>
      <link>https://forem.com/jackwind/is-1000hz-possible-in-chrome-bypassing-the-event-loop-to-test-mouse-polling-rate-3b9k</link>
      <guid>https://forem.com/jackwind/is-1000hz-possible-in-chrome-bypassing-the-event-loop-to-test-mouse-polling-rate-3b9k</guid>
      <description>&lt;p&gt;As a PC gamer, I've always hated installing 500MB of bloatware (looking at you, Razer Synapse and G-Hub) just to verify if my mouse is actually running at its advertised 1000Hz polling rate.&lt;/p&gt;

&lt;p&gt;I asked myself: Why can't I just test this in the browser?&lt;/p&gt;

&lt;p&gt;The common answer is: "You can't. The browser is too slow. requestAnimationFrame is capped at your monitor's refresh rate (usually 60Hz or 144Hz)."&lt;/p&gt;

&lt;p&gt;Challenge accepted. 🛠️&lt;/p&gt;

&lt;p&gt;I spent the last few weeks building &lt;a href="https://hardwaretest.org/mouse-polling-rate-test/" rel="noopener noreferrer"&gt;https://hardwaretest.org/mouse-polling-rate-test/&lt;/a&gt;, a privacy-first diagnostic suite. The hardest part was getting accurate, raw input readings that bypass the visual rendering loop.&lt;/p&gt;

&lt;p&gt;Here is how I solved the "1000Hz Problem" in Vanilla JS.&lt;/p&gt;

&lt;p&gt;The Problem: Visuals vs. Inputs&lt;br&gt;
Most web animations rely on requestAnimationFrame (rAF). If your monitor is 60Hz, rAF fires every ~16.6ms. If you try to measure a 1000Hz mouse (which sends data every 1ms) inside a rAF loop, you will miss 94% of the data.&lt;/p&gt;

&lt;p&gt;We need to decouple the Input Thread from the Render Thread.&lt;/p&gt;

&lt;p&gt;The Solution: pointermove + performance.now()&lt;br&gt;
We can't rely on the screen painting. We need to listen to the raw pointermove event, which fires much more frequently than the screen updates in modern browsers (Chrome/Edge handle this effectively via "Coalesced Events" logic, though we want the raw stream).&lt;/p&gt;

&lt;p&gt;But standard Date.now() isn't precise enough. It gives us milliseconds. For 1000Hz, we need microseconds.&lt;/p&gt;

&lt;p&gt;Enter the High Resolution Time API.&lt;/p&gt;

&lt;p&gt;The Code&lt;br&gt;
Here is the simplified logic of how I calculate the instant Polling Rate (Hz):&lt;/p&gt;

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

&lt;p&gt;let lastEventTime = 0;&lt;br&gt;
let pollingRateSamples = [];&lt;/p&gt;

&lt;p&gt;window.addEventListener('pointermove', (event) =&amp;gt; {&lt;br&gt;
  // 1. Get the microsecond-precise timestamp&lt;br&gt;
  const currentEventTime = performance.now();&lt;/p&gt;

&lt;p&gt;// 2. Calculate the delta (time between two events)&lt;br&gt;
  const timeDelta = currentEventTime - lastEventTime;&lt;/p&gt;

&lt;p&gt;// 3. Convert to Frequency (Hz)&lt;br&gt;
  // Hz = 1000ms / delta&lt;br&gt;
  const instantaneousHz = 1000 / timeDelta;&lt;/p&gt;

&lt;p&gt;// 4. Filter out noise (idle or super slow movements)&lt;br&gt;
  if (instantaneousHz &amp;gt; 10 &amp;amp;&amp;amp; instantaneousHz &amp;lt; 8000) {&lt;br&gt;
    pollingRateSamples.push(instantaneousHz);&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;lastEventTime = currentEventTime;&lt;/p&gt;

&lt;p&gt;// NOTE: Do NOT update the DOM here!&lt;br&gt;
  // Updating the UI every 1ms will kill the browser performance.&lt;br&gt;
  // Store the data, and visualize it in a separate requestAnimationFrame loop.&lt;br&gt;
});&lt;br&gt;
The "Event Loop" Trap&lt;br&gt;
The tricky part is that browsers try to "group" events to save battery.&lt;/p&gt;

&lt;p&gt;If you run a heavy operation inside that pointermove listener, the browser will start throttling the event firing rate to match the frame rate.&lt;/p&gt;

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

&lt;p&gt;Keep the event listener extremely lightweight (just math and array pushing).&lt;/p&gt;

&lt;p&gt;De-couple the visualization. Use a separate requestAnimationFrame loop to read from the pollingRateSamples array and draw the graph.&lt;/p&gt;

&lt;p&gt;The Result&lt;br&gt;
By separating the input capture from the rendering, I managed to get consistent readings matching local software:&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.amazonaws.com%2Fuploads%2Farticles%2F2vaknzle5r48v76cua7n.gif" 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.amazonaws.com%2Fuploads%2Farticles%2F2vaknzle5r48v76cua7n.gif" alt=" " width="8" height="14"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can try the live demo here: Mouse Polling Rate Test&lt;/p&gt;

&lt;p&gt;It also includes a Gamepad Tester (for stick drift) and a Dead Pixel test, all running locally in the browser.&lt;/p&gt;

&lt;p&gt;Discussion 💬&lt;br&gt;
I built this to prove that modern Web APIs are powerful enough to replace most "utility" desktop software.&lt;/p&gt;

&lt;p&gt;What do you think? Are we at a point where we can finally uninstall those 500MB driver suites, or will native apps always be king for hardware interaction?&lt;/p&gt;

&lt;p&gt;Let me know in the comments! 👇&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Vibe Coded a Hardware Tester in a Weekend. (Spoiler: The UI took 10 mins, the Physics took 2 days)</title>
      <dc:creator>jack</dc:creator>
      <pubDate>Wed, 17 Dec 2025 04:15:46 +0000</pubDate>
      <link>https://forem.com/jackwind/vibe-coded-a-hardware-tester-in-a-weekend-spoiler-the-ui-took-10-mins-the-physics-took-2-days-1f3j</link>
      <guid>https://forem.com/jackwind/vibe-coded-a-hardware-tester-in-a-weekend-spoiler-the-ui-took-10-mins-the-physics-took-2-days-1f3j</guid>
      <description>&lt;p&gt;The Vibe: I wanted to build a simple, privacy-focused tool to test PC hardware (Mice, Keyboards, Screens) without installing shady .exe files.&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.amazonaws.com%2Fuploads%2Farticles%2F42h0ogckaohf9n8pbxdl.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.amazonaws.com%2Fuploads%2Farticles%2F42h0ogckaohf9n8pbxdl.png" alt=" " width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Tool: I opened my AI editor (Cursor/Claude), entered "flow state," and started prompting. My goal was &lt;a href="http://www.hardwaretest.org" rel="noopener noreferrer"&gt;www.hardwaretest.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is what I learned about the reality of Vibe Coding a tool that requires high-precision hardware interaction.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where Vibe Coding Shines (The UI)
This part felt like magic.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;"Make it dark mode." -&amp;gt; Done.&lt;/p&gt;

&lt;p&gt;"Give me a grid of clickable colors for dead pixel testing." -&amp;gt; Done.&lt;/p&gt;

&lt;p&gt;"Make it responsive for mobile." -&amp;gt; Done.&lt;/p&gt;

&lt;p&gt;In about 2 hours, I had a beautiful, functional frontend deployed on Vercel. If I were hand-coding the CSS/Tailwind, this would have taken me a full day.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where the Vibe Died (The Logic)
Then I tried to implement the Keyboard Polling Rate Test. I needed to detect if a gaming keyboard was actually reporting at 1000Hz (1ms latency).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I asked the AI: "Write a script to measure key press intervals." The AI confidently spit out code using standard Date.now() and addEventListener.&lt;/p&gt;

&lt;p&gt;The Result? Jittery garbage data. The AI didn't understand that:&lt;/p&gt;

&lt;p&gt;The Browser Event Loop is often slower than a high-end keyboard.&lt;/p&gt;

&lt;p&gt;Date.now() isn't precise enough for sub-millisecond measurements.&lt;/p&gt;

&lt;p&gt;DOM updates (rendering the number) cause layout thrashing that slows down the measurement.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The "Manual Mode" Fix
I had to snap out of "Vibe Mode" and put on my Senior Engineer hat. I spent the next 48 hours manually debugging and rewriting the core logic.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Switched to performance.now() for microsecond precision.&lt;/p&gt;

&lt;p&gt;Implemented a sliding window average algorithm to smooth out the browser's main thread jitter.&lt;/p&gt;

&lt;p&gt;Decoupled the Input Loop (data capture) from the Render Loop (requestAnimationFrame).&lt;/p&gt;

&lt;p&gt;The Verdict&lt;br&gt;
Vibe Coding is a force multiplier, but it's not a replacement for domain knowledge.&lt;/p&gt;

&lt;p&gt;AI built the vessel (UI, Layout, SEO schema).&lt;/p&gt;

&lt;p&gt;I had to build the engine (Timing algorithms, Physics).&lt;/p&gt;

&lt;p&gt;The tool is now live and stable. It features a Keyboard Tester, Mouse Double-Click Detector, and a Dead Pixel Fixer (Canvas-based).&lt;/p&gt;

&lt;p&gt;Check it out here: 👉 &lt;a href="http://www.hardwaretest.org" rel="noopener noreferrer"&gt;www.hardwaretest.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm curious—has anyone else hit a wall where AI implies "it works" but the underlying physics/logic is completely broken?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
    </item>
    <item>
      <title>I Tried "Vibe Coding" a Hardware Test Site: AI is Powerful, But It's Not Magic (Yet) 🛠️</title>
      <dc:creator>jack</dc:creator>
      <pubDate>Tue, 09 Dec 2025 01:35:32 +0000</pubDate>
      <link>https://forem.com/jackwind/i-tried-vibe-coding-a-hardware-test-site-ai-is-powerful-but-its-not-magic-yet-4gn5</link>
      <guid>https://forem.com/jackwind/i-tried-vibe-coding-a-hardware-test-site-ai-is-powerful-but-its-not-magic-yet-4gn5</guid>
      <description>&lt;p&gt;👋 The Backstory&lt;br&gt;
I want to share a recent "experimental project" of mine: HardwareTest.org.&lt;/p&gt;

&lt;p&gt;The motivation was simple: I bought some new peripherals and wanted to test them. But I was fed up with the existing tools—screens full of ads, outdated UIs, or sketchy .exe files that I didn't want to download.&lt;/p&gt;

&lt;p&gt;As a self-described "average developer," I recently got brainwashed by the concept of "Vibe Coding" (coding by natural language/AI intuition). I thought, "AI is so strong now. I'll just write the prompts, let the AI write the code, and I'll be done in minutes, right?"&lt;/p&gt;

&lt;p&gt;Spoiler Alert: I was too naive. 😂&lt;br&gt;
While AI absolutely lowered the barrier to entry and boosted my speed by 10x, taking a tool from "it works" to "it feels good to use" was full of hidden traps.&lt;/p&gt;

&lt;p&gt;🚧 The Real Challenges&lt;br&gt;
Here is a breakdown of the actual struggles I faced while pair-programming with AI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Tooling Chaos&lt;br&gt;
My workflow was a bit of a mess. I started with Antigravity (it designed the initial UI), but ran out of credits. I switched to Codex to finish the logic. For the blog content, I used Gemini, but integrating that content back into the project via Codex resulted in a formatting nightmare. It was a lot of back-and-forth "fixing" what the AI broke.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Browser Limitations vs. Physics (The Keyboard Test)&lt;br&gt;
I thought testing Keyboard Polling Rate would be simple: just tell the AI to "write an event listener."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Reality: I discovered that the browser's Event Loop often can't even keep up with a 1000Hz gaming keyboard. The raw data coming out was jittery and unusable. The Fix: I was forced into dozens of rounds of conversation with the AI. We had to optimize the algorithm, add debounce logic, and implement sliding averages just to get a relatively accurate "Real-time Hz Dashboard" on the web.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Devil is in the Details (The Mouse Test)&lt;br&gt;
I assumed a mouse test was just listening for onClick. The Reality: To properly test for Double Click issues (a gamer's nightmare) and Scroll Wheel rollback, you need very precise counting logic. Also, the AI kept confusing "Middle Click" (pressing the wheel) with "Scrolling" (spinning the wheel). It took a lot of human intervention to separate those events cleanly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The SEO Battle&lt;br&gt;
Writing the code was just step one. To get this English-language site indexed by Google, I spent ages wrestling with Schema, FAQ, and JSON-LD. The Insight: AI writes syntactically correct code, but often logically nonsensical SEO tags. This led to Google Search Console errors that I had to manually debug and patch.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;✨ The Result&lt;/p&gt;

&lt;p&gt;Despite the process being more twisted than I expected, I’m still proud of what this experiment produced.&lt;br&gt;
It became a pure static, ad-free, dark-mode online hardware diagnostic suite — and more importantly, a real-world test of what AI-assisted coding can and cannot do well.&lt;/p&gt;

&lt;p&gt;The original experiment is available here:&lt;br&gt;
👉 &lt;a href="https://hardwaretest.org" rel="noopener noreferrer"&gt;https://hardwaretest.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current Features:&lt;/p&gt;

&lt;p&gt;⌨️ Keyboard Test: Visualizer with a real-time Hz polling rate dashboard (and Ghosting/NKRO support).&lt;/p&gt;

&lt;p&gt;🖱️ Mouse Test: Left/Right/Middle buttons + Scroll Wheel + Double Click detection.&lt;/p&gt;

&lt;p&gt;🖥️ Dead Pixel &amp;amp; Fixer: Standard color cycle test, plus a "High-Frequency Noise Repair" feature built with Canvas.&lt;/p&gt;

&lt;p&gt;🎧 Audio Test: Left/Right channel separation + Logarithmic Sweep.&lt;/p&gt;

&lt;p&gt;This "Vibe Coding" experience taught me a valuable lesson: AI is an incredibly fast junior developer. It can speed up production by 1000%, but it cannot yet replace the human eye for product details, edge cases, and user experience.&lt;/p&gt;

&lt;p&gt;🙏 Feedback Welcome! The site just went live, so there are definitely bugs and rough edges. If you have a moment to try it out, I’d love to hear your feedback in the comments!&lt;/p&gt;




&lt;h2&gt;
  
  
  Update (Several weeks later)
&lt;/h2&gt;

&lt;p&gt;After the initial launch, I ran into a problem I didn’t expect at all — SEO.&lt;/p&gt;

&lt;p&gt;The AI-generated structure worked fine visually, but Google treated most pages as duplicates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;very similar raw HTML&lt;/li&gt;
&lt;li&gt;reused meta descriptions&lt;/li&gt;
&lt;li&gt;canonical pointing to the homepage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a result, many URLs were canonicalized away in Google Search Console.&lt;/p&gt;

&lt;p&gt;Instead of patching the old structure endlessly, I decided to take a more radical approach:&lt;br&gt;
I extracted the most requested feature — mouse polling rate testing — and rebuilt it as &lt;strong&gt;&lt;a href="https://mousepollingratetest.com/" rel="noopener noreferrer"&gt;a dedicated mouse polling rate testing tool&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This time, I avoided “AI-generated SEO” entirely and relied on proper SEO fundamentals.&lt;br&gt;
The difference in indexing and visibility was immediately noticeable.&lt;/p&gt;

&lt;p&gt;This experience reinforced something important for me:&lt;br&gt;
AI can write code fast, but search engines still reward human judgment and structure.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
