<?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: szp2005</title>
    <description>The latest articles on DEV Community by szp2005 (@szp2005).</description>
    <link>https://dev.to/szp2005</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%2F3954570%2Fc95d8429-edc0-4742-aef7-a8a16b1e0bdb.png</url>
      <title>DEV Community: szp2005</title>
      <link>https://dev.to/szp2005</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/szp2005"/>
    <language>en</language>
    <item>
      <title>Our cutouts had the right alpha and the wrong colors: a 0.5154 fringe score, and the fix</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Tue, 17 Nov 2026 02:37:52 +0000</pubDate>
      <link>https://dev.to/szp2005/our-cutouts-had-the-right-alpha-and-the-wrong-colors-a-05154-fringe-score-and-the-fix-57gh</link>
      <guid>https://dev.to/szp2005/our-cutouts-had-the-right-alpha-and-the-wrong-colors-a-05154-fringe-score-and-the-fix-57gh</guid>
      <description>&lt;p&gt;For a while our in-browser background remover looked fine on a white page and bad on everything else. Pasted onto a dark background, a beach photo kept a pale rim, and a green-grass photo kept a green one.&lt;/p&gt;

&lt;p&gt;The mask wasn't the problem. The colors were.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was actually wrong
&lt;/h2&gt;

&lt;p&gt;The model outputs a low-resolution alpha matte (768x768 at the time). We stretched it back to the original size with canvas bilinear scaling and applied it with &lt;code&gt;destination-in&lt;/code&gt;. That had two side effects.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Soft edges.&lt;/strong&gt; A 4000px photo with a 768px mask means the mask is upscaled about 5x, so every edge turns into a gradient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color fringe.&lt;/strong&gt; A semi-transparent edge pixel is a blend: &lt;code&gt;I = alpha*F + (1-alpha)*B&lt;/code&gt;. We changed alpha but left &lt;code&gt;I&lt;/code&gt; as it was, so the old background &lt;code&gt;B&lt;/code&gt; stayed baked into the edge.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can't see the second one until you move the cutout onto a new background.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring it, because "looks better" isn't a number
&lt;/h2&gt;

&lt;p&gt;I defined a fringe score: inside the semi-transparent band, project the output foreground color onto the direction (local background color minus local foreground color). 0 means pure foreground color; 1 means it is entirely background color.&lt;/p&gt;

&lt;p&gt;I ran it on two public sets (both MIT) with the same model output, changing only the post-processing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Set&lt;/th&gt;
&lt;th&gt;Images&lt;/th&gt;
&lt;th&gt;Fringe score before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AIM-500&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;0.5154&lt;/td&gt;
&lt;td&gt;0.0610&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P3M-500-NP (portraits)&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;0.4489&lt;/td&gt;
&lt;td&gt;0.0135&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On AIM-500, the hair/fur/transparent images (43 of them) went from 0.536 to 0.118, and the 33 non-salient images went from 0.552 to 0.135. No category got worse.&lt;/p&gt;

&lt;p&gt;A real browser run on a 1920x1080 kangaroo photo, using the WebGPU path we had then, gave 0.4482 before and -0.0315 after. That confirmed production was going through the refine path, not the fallback.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Two steps, both O(n), both in the image Worker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guided-filter upsampling&lt;/strong&gt; (He et al.) fixes the soft edge. Solve the linear coefficients (a, b) at mask resolution, upsample them, and apply them to the full-resolution grayscale image, so alpha snaps back to the real image edges. The window radius is 3 mask pixels (&lt;code&gt;guidedRadius: 3&lt;/code&gt;, &lt;code&gt;guidedEps: 1e-4&lt;/code&gt;). Radius 4 made opaque-object alpha error 5% worse than no refinement at all. Radius 2 did better on opaque objects but clearly worse on hair and transparent things, which were the hard cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-level foreground estimation&lt;/strong&gt; (Germer et al., 2020) fixes the color. Instead of keeping &lt;code&gt;I&lt;/code&gt;, solve &lt;code&gt;I = alpha*F + (1-alpha)*B&lt;/code&gt; for &lt;code&gt;F&lt;/code&gt; and output &lt;code&gt;F&lt;/code&gt;. Because &lt;code&gt;F&lt;/code&gt; is low-frequency, it's estimated at no more than 2 million pixels and upsampled with no visible loss.&lt;/p&gt;

&lt;p&gt;If anything throws, the caller falls back to the old stretch path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it cost, and what it didn't buy
&lt;/h2&gt;

&lt;p&gt;Post-processing added 199 ms on the benchmark.&lt;/p&gt;

&lt;p&gt;Alpha accuracy barely moved. On AIM-500, SAD went from 17.14 to 16.14, about 6%; on P3M-500-NP it went from 6.53 to 6.38. The big win here is the color, not the mask.&lt;/p&gt;

&lt;p&gt;For the mask, resolution mattered much more. With the same weights and only the input size changed, going from 512 to 768 cut SAD by 19% (21.16 to 17.14). Refined 512 (20.66) was still worse than unrefined 768 (17.14). Post-processing doesn't make up for a smaller input.&lt;/p&gt;

&lt;p&gt;Against remove.bg's free preview tier, on 30 stratified samples, median SAD was 1.15 (remove.bg) vs 1.20 (ours), and median fringe score was 0.413 vs 0.039. Two caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The preview tier outputs about 0.25MP, so I resampled everything to its size and scored it against the same ground truth. I can't say the result matches the paid full-size tier.&lt;/li&gt;
&lt;li&gt;On transparent objects, SAD lied. Two glass images (a cola pouring into a glass, and a stack of glasses) scored in our favor because we had cut out almost nothing and the ground-truth alpha in glass is low. Looking at the images showed remove.bg was clearly better there. For that category I trust a visual check over the number.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you do this yourself
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Measure the fringe against a colored background, not white. White hides most of it.&lt;/li&gt;
&lt;li&gt;Don't saturate alpha to 0/1 near edges to hide fog. It destroys real translucency.&lt;/li&gt;
&lt;li&gt;Write a synthetic test: compose &lt;code&gt;I&lt;/code&gt; from a known &lt;code&gt;F&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, and &lt;code&gt;alpha&lt;/code&gt;, then recover &lt;code&gt;F&lt;/code&gt;. Ours is in &lt;code&gt;scripts/test-matting-refine.mjs&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The numbers above are from the 2026-09-12 benchmark on the 768x768 pipeline. The current pipeline uses a larger input, so rerun the scores before quoting mine.&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://remove.ac/?utm_source=devto" rel="noopener noreferrer"&gt;remove.ac&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I build remove.ac.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>imageprocessing</category>
      <category>performance</category>
    </item>
    <item>
      <title>Formatting 50 Product Cutouts for Amazon, Shopify, and Etsy in One Browser Pass (OffscreenCanvas Workers, Zero Re-Inference)</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Mon, 16 Nov 2026 03:09:27 +0000</pubDate>
      <link>https://dev.to/szp2005/formatting-50-product-cutouts-for-amazon-shopify-and-etsy-in-one-browser-pass-offscreencanvas-1fc</link>
      <guid>https://dev.to/szp2005/formatting-50-product-cutouts-for-amazon-shopify-and-etsy-in-one-browser-pass-offscreencanvas-1fc</guid>
      <description>&lt;p&gt;When sellers export product photos for multiple storefronts, background removal is only half the work. Each marketplace enforces different geometry and encoding rules that quietly break naive exports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon main images&lt;/strong&gt; require pure &lt;code&gt;#FFFFFF&lt;/code&gt; RGB &lt;code&gt;(255, 255, 255)&lt;/code&gt;, the product filling roughly 85% of the frame, &lt;code&gt;&amp;gt;= 1,600 px&lt;/code&gt; on the longest side for zoom (&lt;code&gt;2,000 x 2,000&lt;/code&gt; square is standard), and JPEG output without stray props or detached cast shadows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shopify collection grids&lt;/strong&gt; look uneven when tall bottles and wide bags are centered by bounding-box midpoint rather than resting on a shared bottom shelf line (&lt;code&gt;2,048 x 2,048&lt;/code&gt; WebP/PNG with a 10% bottom baseline margin fixes the "jumping row" effect).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Etsy listing thumbnails&lt;/strong&gt; flatten transparent PNG alpha channels to solid black in several views and crop first-slot thumbnails to &lt;code&gt;4:3&lt;/code&gt; (&lt;code&gt;2,667 x 2,000&lt;/code&gt; or &lt;code&gt;2,000 x 2,000&lt;/code&gt; opaque JPEG avoids both traps).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running neural segmentation three separate times just to export Amazon, Shopify, and Etsy variants wastes 3x the compute and crashes mobile tabs. Here is how we decoupled alpha inference from marketplace composition in &lt;a href="https://remove.ac/batch" rel="noopener noreferrer"&gt;remove.ac/batch&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Run alpha inference once and cache compact matte intermediates
&lt;/h3&gt;

&lt;p&gt;On first visit, the browser caches ~80 MB of quantized ONNX weights locally (single-image Studio handles up to &lt;code&gt;20 MB / 32 MP&lt;/code&gt;, and Batch handles up to 50 images per ZIP). When a user drops up to 50 photos into &lt;code&gt;/batch?preset=amazon-main&lt;/code&gt;, the WASM worker runs segmentation once per image and retains the foreground cutout alongside connected-component alpha bounds.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Connected-component alpha bounds that ignore stray dust specks
&lt;/h3&gt;

&lt;p&gt;A classic bug in "85% frame fill" auto-cropping is scanning raw &lt;code&gt;alpha &amp;gt; 0&lt;/code&gt; pixels. A single &lt;code&gt;2x2&lt;/code&gt; semi-transparent dust speck near the bottom corner inflates the bounding box, shrinks the actual product to 55% of the canvas, and detaches grounded contact shadows so the item looks like it is floating.&lt;/p&gt;

&lt;p&gt;Before computing scale and shelf alignment, our composer filters out isolated micro-components below a minimum pixel-area threshold while preserving thin handle loops attached to the main subject. Grounded contact shadows are anchored to the denoised subject base rather than the raw alpha extrema.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Zero-reinference retemplating inside a dedicated &lt;code&gt;OffscreenCanvas&lt;/code&gt; worker
&lt;/h3&gt;

&lt;p&gt;Switching a finished 50-image batch from &lt;a href="https://remove.ac/use-cases/amazon" rel="noopener noreferrer"&gt;Amazon 2000x2000 pure white JPG&lt;/a&gt; to &lt;a href="https://remove.ac/use-cases/shopify" rel="noopener noreferrer"&gt;Shopify 2048x2048 shelf-aligned WebP&lt;/a&gt; or &lt;a href="https://remove.ac/use-cases/etsy" rel="noopener noreferrer"&gt;Etsy 2667x2000 4:3 opaque JPG&lt;/a&gt; never re-runs the neural network. A dedicated &lt;code&gt;OffscreenCanvas&lt;/code&gt; worker composites each cached cutout onto the target aspect ratio, applies optional grounded floor shadow, encodes JPEG/WebP/PNG (with automatic lossless PNG fallback on engines like WebKit that omit &lt;code&gt;OffscreenCanvas&lt;/code&gt; WebP encoding), and streams the output into a store-mode ZIP archive while revoking intermediate &lt;code&gt;ImageBitmap&lt;/code&gt; buffers frame by frame.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benchmarks and automated pipelines
&lt;/h3&gt;

&lt;p&gt;We publish rolling 90-day real-device WebAssembly latency percentiles (&lt;code&gt;2,200+&lt;/code&gt; real browser runs across Chromium and WebKit) under &lt;code&gt;CC BY 4.0&lt;/code&gt; at &lt;a href="https://remove.ac/benchmarks" rel="noopener noreferrer"&gt;remove.ac/benchmarks&lt;/a&gt;. For teams automating &lt;code&gt;&amp;gt;50&lt;/code&gt; SKUs, exploring &lt;a href="https://remove.ac/design_templates" rel="noopener noreferrer"&gt;studio design templates&lt;/a&gt;, or migrating scripts before the &lt;a href="https://remove.ac/guides/remove-bg-shutdown" rel="noopener noreferrer"&gt;December 1, 2026 remove.bg shutdown&lt;/a&gt;, see the &lt;a href="https://remove.ac/remove-bg-alternative" rel="noopener noreferrer"&gt;remove.bg alternative overview&lt;/a&gt;. &lt;code&gt;POST https://remove.ac/v1.0/removebg&lt;/code&gt; accepts single-call streams up to &lt;code&gt;25 MB / 50 MP&lt;/code&gt; (&lt;code&gt;pricing&lt;/code&gt;: &lt;a href="https://remove.ac/pricing" rel="noopener noreferrer"&gt;https://remove.ac/pricing&lt;/a&gt;, &lt;code&gt;API docs&lt;/code&gt;: &lt;a href="https://remove.ac/api-info" rel="noopener noreferrer"&gt;https://remove.ac/api-info&lt;/a&gt;) with 10 free full-resolution welcome credits (valid 30 days) on verified accounts.&lt;/p&gt;

</description>
      <category>performance</category>
    </item>
    <item>
      <title>Migrating off /v1.0/removebg before the Dec 1, 2026 shutdown (Python, Node.js, n8n, and GitHub Actions)</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Sat, 14 Nov 2026 12:02:24 +0000</pubDate>
      <link>https://dev.to/szp2005/migrating-off-v10removebg-before-the-dec-1-2026-shutdown-python-nodejs-n8n-and-github-23fg</link>
      <guid>https://dev.to/szp2005/migrating-off-v10removebg-before-the-dec-1-2026-shutdown-python-nodejs-n8n-and-github-23fg</guid>
      <description>&lt;p&gt;On December 1, 2026 at 09:00 CET, standalone &lt;code&gt;remove.bg&lt;/code&gt; and its self-serve &lt;code&gt;POST https://api.remove.bg/v1.0/removebg&lt;/code&gt; endpoint shut down.&lt;/p&gt;

&lt;p&gt;If you maintain older catalog pipelines, cron scripts, or n8n workflows wired to &lt;code&gt;/v1.0/removebg&lt;/code&gt;, the two official Canva Group destinations require code changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Leonardo.Ai Sync v2&lt;/strong&gt; uses a static Bearer key, yet you have to replace multipart &lt;code&gt;image_file&lt;/code&gt; calls with a v2 JSON schema, rewrite your response parser to pull image URLs, and pass &lt;code&gt;"ephemeral": true&lt;/code&gt; on each call if you want temporary storage behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canva Connect&lt;/strong&gt; requires registering an OAuth 2.0 integration and refreshing user access tokens, which fits user-facing apps better than headless backend workers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over the past few weeks I built &lt;a href="https://remove.ac" rel="noopener noreferrer"&gt;remove.ac&lt;/a&gt; to keep &lt;code&gt;/v1.0/removebg&lt;/code&gt; callers running with a two-line swap (endpoint URL plus &lt;code&gt;X-Api-Key&lt;/code&gt;), paired with a free browser WebAssembly workbench for manual batches. Below are the migration patterns for Python, Node.js, n8n, and CI pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Direct &lt;code&gt;curl&lt;/code&gt; or HTTP Request Node Swap
&lt;/h3&gt;

&lt;p&gt;Standard &lt;code&gt;multipart/form-data&lt;/code&gt; (&lt;code&gt;image_file&lt;/code&gt;), JSON (&lt;code&gt;image_url&lt;/code&gt; or &lt;code&gt;image_file_b64&lt;/code&gt;), &lt;code&gt;Accept: application/json&lt;/code&gt; (&lt;code&gt;data.result_b64&lt;/code&gt;), and &lt;code&gt;X-Foreground-*&lt;/code&gt; bounding-box headers follow the original &lt;code&gt;/v1.0/removebg&lt;/code&gt; field names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -f -X POST https://remove.ac/v1.0/removebg \
  -H &lt;span class="s2"&gt;"X-Api-Key: rac_live_your_key_here"&lt;/span&gt; \
  -F &lt;span class="s2"&gt;"image_file=@shoe.jpg"&lt;/span&gt; \
  -F &lt;span class="s2"&gt;"size=full"&lt;/span&gt; \
  -F &lt;span class="s2"&gt;"format=png"&lt;/span&gt; \
  -o shoe-nobg.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Payloads up to 4.4 MB run straight through the edge proxy into NVIDIA L4 GPU memory with zero disk persistence of source or output images. Failed or timed-out requests release their credit hold automatically and charge 0 credits.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Python (&lt;code&gt;requests&lt;/code&gt; or &lt;code&gt;removebg&lt;/code&gt; Shim, Including &amp;gt;4.4 MB Studio Photos)
&lt;/h3&gt;

&lt;p&gt;If your script imports &lt;code&gt;from removebg import RemoveBg&lt;/code&gt; or calls &lt;code&gt;requests.post&lt;/code&gt;, install the zero-dependency package from PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install remove-ac
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;remove_ac&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;RemoveAcClient&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RemoveAcClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# reads REMOVE_AC_API_KEY&lt;/span&gt;
&lt;span class="n"&gt;png_bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove_background&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"studio-raw-16mb.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"full"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;crop&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="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"studio-cutout.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"wb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;png_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the file exceeds 4 MB (or is an uncropped &amp;gt;5 MP RGBA PNG), the client automatically requests a 180-second single-use HMAC ticket from &lt;code&gt;POST /v1.0/removebg/ticket&lt;/code&gt; and streams up to 25 MB / 40 MP directly to ephemeral GPU RAM so serverless 4.5 MB body caps never reject studio shots with HTTP 413.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Self-Hosted n8n Workflows (&lt;code&gt;n8n-nodes-remove-ac&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Built-in &lt;code&gt;Remove.bg&lt;/code&gt; nodes in n8n hit the retiring &lt;code&gt;/v1.0/removebg&lt;/code&gt; endpoint. In self-hosted or desktop n8n, go to &lt;strong&gt;Settings -&amp;gt; Community Nodes -&amp;gt; Install&lt;/strong&gt; and install &lt;code&gt;n8n-nodes-remove-ac&lt;/code&gt;. It accepts upstream binary properties (&lt;code&gt;data&lt;/code&gt;) up to 25 MB or public image URLs, outputs the cutout binary alongside &lt;code&gt;X-Foreground-*&lt;/code&gt; coordinates, and exposes &lt;code&gt;usableAsTool: true&lt;/code&gt; for n8n AI Agent workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. GitHub Actions (&lt;code&gt;szp2005/remove-ac-sdk@v1.1.2&lt;/code&gt;) and MCP (&lt;code&gt;remove-ac-mcp&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;For storefront repositories that clean product images on pull requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;szp2005/remove-ac-sdk@v1.1.2&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;api_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.REMOVE_AC_API_KEY }}&lt;/span&gt;
    &lt;span class="na"&gt;input_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"public/products/incoming"&lt;/span&gt;
    &lt;span class="na"&gt;output_dir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"public/products/transparent"&lt;/span&gt;
    &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"full"&lt;/span&gt;
    &lt;span class="na"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For local coding agents (&lt;code&gt;Claude Desktop&lt;/code&gt;, &lt;code&gt;Cursor&lt;/code&gt;, &lt;code&gt;VS Code&lt;/code&gt;), run &lt;code&gt;npx -y -p remove-ac remove-ac-mcp&lt;/code&gt; (&lt;code&gt;io.github.szp2005/remove-ac&lt;/code&gt;). It writes transparent cutouts straight to disk instead of dumping megabytes of base64 into your model context window.&lt;/p&gt;

&lt;h3&gt;
  
  
  When You Do Not Need an API Key at All
&lt;/h3&gt;

&lt;p&gt;If a designer or seller on your team processes batches manually in a browser, &lt;a href="https://remove.ac/batch" rel="noopener noreferrer"&gt;remove.ac/batch&lt;/a&gt; runs a quantized WebAssembly segmentation pipeline inside the browser tab. The first visit downloads ~80 MB of ONNX weights into the browser cache; after that, single exports (up to 20 MB / 32 MP) and 50-image batch ZIPs run in local memory without login or uploads. Verified email accounts on the cloud API receive 1 free welcome credit, pay-as-you-go packs never expire ($9 for 10 credits up to $399 for 1,200), and monthly plans drop to $0.158/image.&lt;/p&gt;

&lt;p&gt;Full field-by-field migration table: &lt;a href="https://remove.ac/guides/remove-bg-api-migration" rel="noopener noreferrer"&gt;https://remove.ac/guides/remove-bg-api-migration&lt;/a&gt;&lt;br&gt;
Open-source SDK, CLI, GitHub Action &amp;amp; MCP (&lt;code&gt;MIT&lt;/code&gt;): &lt;a href="https://github.com/szp2005/remove-ac-sdk" rel="noopener noreferrer"&gt;https://github.com/szp2005/remove-ac-sdk&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>node</category>
      <category>automation</category>
    </item>
    <item>
      <title>Shipping in-browser WASM background removal without crashing Safari tabs (+ an open real-device latency dataset)</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Fri, 13 Nov 2026 06:36:09 +0000</pubDate>
      <link>https://dev.to/szp2005/shipping-in-browser-wasm-background-removal-without-crashing-safari-tabs-an-open-real-device-5f5l</link>
      <guid>https://dev.to/szp2005/shipping-in-browser-wasm-background-removal-without-crashing-safari-tabs-an-open-real-device-5f5l</guid>
      <description>&lt;p&gt;Over the past month I built and shipped &lt;a href="https://remove.ac" rel="noopener noreferrer"&gt;remove.ac&lt;/a&gt;, an image background remover split into two explicit execution paths: a free in-browser WebAssembly studio where image bytes stay inside the tab, and an optional stateless Cloud GPU API (&lt;code&gt;POST /v1.0/removebg&lt;/code&gt;) compatible with &lt;code&gt;remove.bg&lt;/code&gt; payloads.&lt;/p&gt;

&lt;p&gt;Running a 1024px segmentation model (&lt;code&gt;onnxruntime-web&lt;/code&gt; WASM + guided-filter hair refinement) inside real users' browsers surfaced a few bugs that never showed up on an M-series MacBook during development. Here is what broke, how we fixed it, and the raw telemetry we collected from 2,000+ production runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. WebKit holds onto offscreen &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; memory after unmount
&lt;/h3&gt;

&lt;p&gt;Dropping references to temporary &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; elements in React was enough in Chromium, but iOS and macOS Safari kept hundreds of megabytes of backing-store memory pinned across batch runs. Explicitly zeroing dimensions (&lt;code&gt;canvas.width = 0; canvas.height = 0&lt;/code&gt;) in teardown routines reclaimed memory immediately and stopped mobile tab reloads during 50-image ZIP batches on &lt;a href="https://remove.ac/batch" rel="noopener noreferrer"&gt;&lt;code&gt;/batch&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Bounding manual brush undo history to 64 MB
&lt;/h3&gt;

&lt;p&gt;On a 12 MP product photo, storing 10 undo snapshots as raw RGBA &lt;code&gt;ImageData&lt;/code&gt; eats ~480 MB on its own. For the local &lt;code&gt;Erase / Restore / Smart Brush&lt;/code&gt; and point/box subject selector, we switched to replaying stroke vectors on top of a rolling checkpoint canvas, capping undo history at 12 steps within a 64 MB ceiling.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Never silently fall back from local WASM to a backend server
&lt;/h3&gt;

&lt;p&gt;A subtle trust bug in "hybrid" web tools is catching an out-of-memory WASM error and quietly uploading the file to a cloud worker so the task succeeds. If someone picked on-device processing for an ID scan or unreleased product shot, silent fallback violates the whole point. On &lt;code&gt;remove.ac&lt;/code&gt;, local failures stay local; Cloud GPU runs only when a signed-in user clicks it or calls the API with an &lt;code&gt;X-Api-Key&lt;/code&gt; (&lt;code&gt;rac_live_...&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Bypassing serverless ~4 MB gateway caps without storing user files on S3
&lt;/h3&gt;

&lt;p&gt;Standard serverless HTTP gateways choke around 4.5 MB, which fails as soon as a studio photographer outputs a 15 MB lossless PNG. Instead of staging uploads in an object bucket, our zero-dependency SDKs and CLI request a single-use HMAC ticket from &lt;code&gt;POST /v1.0/removebg/ticket&lt;/code&gt; (placing a Postgres FEFO credit hold) and stream up to &lt;strong&gt;25 MB / 40 MP&lt;/strong&gt; directly into volatile GPU worker RAM. If inference errors out or times out, the credit hold releases automatically at zero cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open SDKs (&lt;code&gt;MIT&lt;/code&gt;) and Real-Device Latency Dataset (&lt;code&gt;CC BY 4.0&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-dependency Node.js &amp;amp; Python SDKs + &lt;code&gt;--watch&lt;/code&gt; folder CLI&lt;/strong&gt;: &lt;a href="https://github.com/szp2005/remove-ac-sdk" rel="noopener noreferrer"&gt;github.com/szp2005/remove-ac-sdk&lt;/a&gt; (includes a 1-line &lt;code&gt;from removebg import RemoveBg&lt;/code&gt; drop-in shim).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rolling 90-day real-device WASM benchmark dataset&lt;/strong&gt;: &lt;a href="https://remove.ac/benchmarks" rel="noopener noreferrer"&gt;remove.ac/benchmarks&lt;/a&gt; — publishes p50/p95 download, session-init, and inference timings across desktop/mobile CPU buckets (raw &lt;a href="https://remove.ac/api/remove-ac/benchmarks/data?format=json" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; and &lt;a href="https://remove.ac/api/remove-ac/benchmarks/data?format=csv" rel="noopener noreferrer"&gt;CSV&lt;/a&gt; under CC BY 4.0, no cherry-picked single-machine numbers).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to poke at the browser WASM studio (no login wall) or test &lt;code&gt;/v1.0/removebg&lt;/code&gt; with the free signup credit, everything is live at &lt;a href="https://remove.ac" rel="noopener noreferrer"&gt;https://remove.ac&lt;/a&gt;. Happy to share details on the guided-filter worker pipeline or the Postgres FEFO ledger SQL!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Three Traps We Hit Building a Browser WASM + Serverless GPU Background Remover</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Wed, 11 Nov 2026 12:16:31 +0000</pubDate>
      <link>https://dev.to/szp2005/three-traps-we-hit-building-a-browser-wasm-serverless-gpu-background-remover-2dj8</link>
      <guid>https://dev.to/szp2005/three-traps-we-hit-building-a-browser-wasm-serverless-gpu-background-remover-2dj8</guid>
      <description>&lt;p&gt;When &lt;code&gt;remove.bg&lt;/code&gt; announced that its standalone web tools and self-serve API are winding down on December 1, 2026, two very different workflows suddenly got lumped together:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Privacy-sensitive single or batch cutouts&lt;/strong&gt;, where uploading raw customer photos, unreleased product shots, or personal images to a third-party cloud editor is a non-starter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated pipelines&lt;/strong&gt; already sending &lt;code&gt;multipart/form-data&lt;/code&gt; with an &lt;code&gt;X-Api-Key&lt;/code&gt; header to &lt;code&gt;POST /v1.0/removebg&lt;/code&gt; and expecting raw PNG bytes back without rewriting their HTTP client around async job polling.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While building an independent dual-path tool to handle both cases cleanly, we hit three browser and backend traps worth sharing if you run ONNX segmentation in WebAssembly or operate a credit-metered GPU API.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Why WebGPU quantization silently broke background alpha
&lt;/h3&gt;

&lt;p&gt;Our initial browser pipeline tried int8-quantized weights on WebGPU first and fell back to WASM SIMD. Timing looked great on WebGPU, yet visual quality collapsed on opaque objects.&lt;/p&gt;

&lt;p&gt;Comparing raw output distributions against an fp32 reference on the exact same input image exposed the root cause: positive foreground logits matched, while negative background logits were crushed upward inside &lt;code&gt;DequantizeLinear&lt;/code&gt; on that runtime version. Pixels that should have been clean &lt;code&gt;alpha = 0&lt;/code&gt; landed in the semi-transparent band instead.&lt;/p&gt;

&lt;p&gt;The lesson: never benchmark a browser ML fallback by latency alone. Log your min/max logits and the fraction of pixels sitting in the soft &lt;code&gt;0.05 &amp;lt; alpha &amp;lt; 0.95&lt;/code&gt; band against fp32 before shipping a new execution provider. Switching the browser path to &lt;code&gt;1024×1024&lt;/code&gt; fp16 weights on multi-threaded WASM (gated behind &lt;code&gt;crossOriginIsolated&lt;/code&gt; via &lt;code&gt;COOP&lt;/code&gt;/&lt;code&gt;COEP&lt;/code&gt; headers) matched fp32 output closely while keeping pixel bytes strictly inside tab memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Fixing color halos when upscaling a fixed-grid mask
&lt;/h3&gt;

&lt;p&gt;Upscaling a square segmentation mask back to a high-resolution camera photo produces two distinct artifacts: stair-stepped edges and background color spill. Semi-transparent boundary pixels still carry RGB values mixed with the old background (&lt;code&gt;I = αF + (1 − α)B&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Pairing a guided filter (using the original full-resolution RGB image as the guidance map) with foreground color decontamination removes most visible color fringes on hair and fur without inventing geometry. And when a photo has two subjects side by side, running a lightweight local geodesic shortest-path pass from positive and negative clicks lets users isolate one subject on Canvas without uploading the file.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Zero-blob idempotency and FEFO credit holds for &lt;code&gt;/v1.0/removebg&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;For scripts migrating off &lt;code&gt;/v1.0/removebg&lt;/code&gt;, compatibility means accepting &lt;code&gt;image_file&lt;/code&gt;, &lt;code&gt;image_file_b64&lt;/code&gt;, or &lt;code&gt;image_url&lt;/code&gt; plus &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;format&lt;/code&gt;, &lt;code&gt;bg_color&lt;/code&gt;, and &lt;code&gt;crop&lt;/code&gt; synchronously.&lt;/p&gt;

&lt;p&gt;Two failure modes matter most in a synchronous GPU gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Charging users when upstream inference times out.&lt;/strong&gt; Instead of deducting credits upfront or after the fact, Postgres claims an atomic FEFO (first-expiring, first-out) hold before forwarding the request to an ephemeral L4 GPU worker. If the worker errors or times out, the hold releases immediately with zero charge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accidental image retention in idempotency caches.&lt;/strong&gt; Storing full output blobs in SQLite or Postgres to replay retries quietly turns a "stateless API" into an image store. Keeping inference in volatile RAM, storing metadata-only idempotency state, and running a periodic &lt;code&gt;PRAGMA wal_checkpoint(TRUNCATE)&lt;/code&gt; sweep avoids retaining user pixels on disk.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to inspect the browser WASM path (with DevTools Network open to verify zero pixel uploads) or test a drop-in &lt;code&gt;/v1.0/removebg&lt;/code&gt; call in the live sandbox, you can try it at &lt;a href="https://remove.ac/remove-ac/en/api-info?utm_source=devto" rel="noopener noreferrer"&gt;remove.ac&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: I build remove.ac.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>machinelearning</category>
      <category>showdev</category>
    </item>
    <item>
      <title>SpeechTranscriber covers about ten languages, and we were telling everyone else their language wasn't supported</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Thu, 29 Oct 2026 02:32:00 +0000</pubDate>
      <link>https://dev.to/szp2005/speechtranscriber-covers-about-ten-languages-and-we-were-telling-everyone-else-their-language-4dg9</link>
      <guid>https://dev.to/szp2005/speechtranscriber-covers-about-ten-languages-and-we-were-telling-everyone-else-their-language-4dg9</guid>
      <description>&lt;p&gt;CapScribe transcribes video on the device with iOS 26's SpeechAnalyzer and then burns the captions into the file. Early versions asked one question before starting: does &lt;code&gt;SpeechTranscriber&lt;/code&gt; have an equivalent for this locale? If the answer was nil, the app said "this language isn't supported for on-device transcription" and stopped.&lt;/p&gt;

&lt;p&gt;For a lot of people that message was false. &lt;code&gt;SpeechTranscriber&lt;/code&gt;, the new high-quality model, covers roughly ten languages. iOS 26 also ships &lt;code&gt;DictationTranscriber&lt;/code&gt;, the dictation model exposed as a module for the same &lt;code&gt;SpeechAnalyzer&lt;/code&gt;, and its list is much longer: around thirty more locales. The OS had a model for these users and we were sending them away.&lt;/p&gt;

&lt;h2&gt;
  
  
  The old check
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;supportedLocale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kt"&gt;SpeechTranscriber&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;supportedLocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;equivalentTo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;locale&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="k"&gt;throw&lt;/span&gt; &lt;span class="kt"&gt;EngineError&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unsupportedLanguage&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One model, one question, and the only other outcome was an error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolve a tier instead of a yes or no
&lt;/h2&gt;

&lt;p&gt;The engine now picks a tier. It tries the modern model first, then the dictation model, and only reports "unsupported" when both say no:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="kt"&gt;TranscriptionEngineTier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;Sendable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;modern&lt;/span&gt;   &lt;span class="c1"&gt;// SpeechTranscriber&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;basic&lt;/span&gt;    &lt;span class="c1"&gt;// DictationTranscriber fallback&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;resolveTier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;TranscriptionEngineTier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;supportedLocale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Locale&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="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;modern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;dependencies&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;modernSupportedLocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;modern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;modern&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="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;basic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;dependencies&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicSupportedLocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;basic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;basic&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="kc"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two branches build different transcribers, but everything after that is shared. You ask &lt;code&gt;AssetInventory&lt;/code&gt; for an installation request, download the model if there is one to download, hand the module to &lt;code&gt;SpeechAnalyzer&lt;/code&gt;, and read results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;transcriber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;DictationTranscriber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;supportedLocale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;contentHints&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="nv"&gt;transcriptionOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;punctuation&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="nv"&gt;reportingOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="nv"&gt;attributeOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audioTimeRange&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transcriptionConfidence&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="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kt"&gt;AssetInventory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assetInstallationRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;supporting&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;transcriber&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;downloadAndInstall&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;Two details are easy to get wrong here.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;supportedLocale(equivalentTo:)&lt;/code&gt; gives back the locale the model actually supports, and that isn't always the one you passed in. So the "is the model already installed?" check compares the returned locale against &lt;code&gt;installedLocales&lt;/code&gt;, not the user's raw setting.&lt;/p&gt;

&lt;p&gt;Word timings are the other one. The dictation path asks for &lt;code&gt;.audioTimeRange&lt;/code&gt;, but whether each word comes back with a range depends on the model. Our collector skips words without a usable range, and if a segment ends up with none, it stores &lt;code&gt;nil&lt;/code&gt; for that segment's word timings. Downstream code then sees "no word timings" rather than numbers we made up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tell people which model they got
&lt;/h2&gt;

&lt;p&gt;A silent fallback would just be a quieter version of the same lie, so the tier shows up in two places.&lt;/p&gt;

&lt;p&gt;The language menu lists modern languages first, then the dictation-only ones with a "(basic quality)" suffix. A language that both models support appears once, in the modern group.&lt;/p&gt;

&lt;p&gt;After a basic-tier run, the editor shows a one-line banner: "This language uses basic recognition with lower accuracy." The engine reports the tier through a callback when it starts transcribing, and the view model stores it. That way the banner reflects what actually ran, not what the menu promised.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing without a real device
&lt;/h2&gt;

&lt;p&gt;Which locales each model supports is an OS fact you don't control in a test run. So the engine takes its lookups as injected closures, and a fallback test can fake a world where the modern model knows nothing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;deps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;TranscriptionEngine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;Dependencies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;isAvailable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nv"&gt;modernSupportedLocale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nv"&gt;basicSupportedLocale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;identifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hasPrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"el"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="kt"&gt;Locale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"el-GR"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kt"&gt;TranscriptionEngine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;deps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolveTier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;for&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Locale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"el-GR"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="kt"&gt;XCTAssertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;basic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same file covers the modern model winning when both answer, both failing, the device being unavailable, and resource status across the two tiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Some users now get captions that need more fixing than before, which is the whole reason the banner exists. The menu got longer, and its order turned into a product decision we have to keep making. I'd still rather hand someone lower-accuracy captions with a clear warning than tell them their language doesn't exist when the OS can handle it.&lt;/p&gt;

&lt;p&gt;CapScribe on the App Store: &lt;a href="https://apps.apple.com/app/id6801041856?utm_source=devto" rel="noopener noreferrer"&gt;https://apps.apple.com/app/id6801041856?utm_source=devto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I build CapScribe.&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>mobile</category>
      <category>ai</category>
    </item>
    <item>
      <title>ONNX Runtime Web fixes its thread count once per page, so our timeout retry had to start a new Worker</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Tue, 27 Oct 2026 02:35:20 +0000</pubDate>
      <link>https://dev.to/szp2005/onnx-runtime-web-fixes-its-thread-count-once-per-page-so-our-timeout-retry-had-to-start-a-new-1b5i</link>
      <guid>https://dev.to/szp2005/onnx-runtime-web-fixes-its-thread-count-once-per-page-so-our-timeout-retry-had-to-start-a-new-1b5i</guid>
      <description>&lt;p&gt;Our background remover runs a BiRefNet model in the browser with ONNX Runtime Web 1.27 on the WASM backend. Multithreaded WASM is the fast path when the page can have it. Sometimes it can't: the worker script gets blocked somewhere on the network, or session creation just hangs. The obvious fix is to catch the timeout and call &lt;code&gt;InferenceSession.create&lt;/code&gt; again with one thread.&lt;/p&gt;

&lt;p&gt;In ORT-web that retry goes nowhere, and the reason is easy to miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the same-page retry is a dead end
&lt;/h2&gt;

&lt;p&gt;The WASM backend is a page-level singleton. The thread count has to be settled before the first &lt;code&gt;create&lt;/code&gt; in that context, and once the runtime is up, setting &lt;code&gt;ort.env.wasm.numThreads&lt;/code&gt; again doesn't give later sessions a different thread pool. So "try multithreaded, fall back to single-threaded" can't happen inside one JavaScript context. You either decide before the first create, or you throw the context away.&lt;/p&gt;

&lt;p&gt;We put that at the top of the module that makes the decision, so nobody "fixes" it later (comment translated from Chinese):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * ORT's WASM backend is a page-level singleton. Thread count must be
 * decided before the first create, so this never returns a
 * "retry single-threaded on the same page" plan.
 */&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decideWasmSessionInit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;configuredThreads&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;storedProbeResult&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="n"&gt;configuredThreads&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;storedProbeResult&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"unavailable"&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"single-thread"&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"multi-thread"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deciding before the first create
&lt;/h2&gt;

&lt;p&gt;The thread count comes from one expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;configuredThreads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;crossOriginIsolated&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;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hardwareConcurrency&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the page isn't cross-origin isolated (no COOP/COEP headers), you get one thread no matter how many cores the machine has. That's the first thing I'd check when someone says ORT-web feels slow. If it is isolated, we cap at 8 and assume 4 when &lt;code&gt;hardwareConcurrency&lt;/code&gt; is missing.&lt;/p&gt;

&lt;p&gt;Isolation alone isn't enough, because ORT's threads are workers and a worker script can still fail to load. So before the first create we start a tiny probe worker whose entire source is &lt;code&gt;postMessage("ok")&lt;/code&gt; and give it 2.5 seconds. An "ok" means multithreaded. An error or a timeout means single-threaded. Either result goes into sessionStorage, so a tab probes once. If sessionStorage throws, as it can in restricted private modes, we still use this run's probe result; it just isn't remembered.&lt;/p&gt;

&lt;h2&gt;
  
  
  When create hangs anyway
&lt;/h2&gt;

&lt;p&gt;The probe can pass and session creation can still stall. We race &lt;code&gt;create&lt;/code&gt; against a 20-second timer. Normal WASM init takes seconds, so hitting that limit usually means a worker request got stuck in the network layer. ORT has no way to abort a create, so if the abandoned one finishes late, we release that session right away instead of leaking it.&lt;/p&gt;

&lt;p&gt;Recovery is where the singleton rule bites. The matting code runs in its own dedicated Worker. On a timeout, that worker reports a &lt;code&gt;WasmSessionInitTimeoutError&lt;/code&gt;. The client sets a &lt;code&gt;forceSingleThread&lt;/code&gt; flag and terminates the Worker, and its heap and threads go with it. The next request gets a fresh Worker that skips the probe and runs single-threaded. The page doesn't reload, so whatever the user uploaded or edited stays where it was.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;The request that timed out still fails. The worker client doesn't retry it on its own, because retrying in place would mean reusing the stuck runtime, and the only other option is reloading the page and losing the user's state.&lt;/p&gt;

&lt;p&gt;Single-threaded is slower. I haven't measured by how much on real devices, so I'm not going to put a number on it.&lt;/p&gt;

&lt;p&gt;One more thing to watch for. The same module still exports a second recovery helper that writes the single-thread flag, reloads the page, and keeps a guard so it only self-heals once. Nothing imports it. Read the module alone and you'd conclude we reload on timeout. We don't. To know which recovery path is live, look at what the caller imports, not at what the helper file offers.&lt;/p&gt;

&lt;p&gt;If you run models with ORT-web, this is what I'd take from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When performance looks wrong, check &lt;code&gt;crossOriginIsolated&lt;/code&gt; before anything else.&lt;/li&gt;
&lt;li&gt;Decide the thread count once, before the first &lt;code&gt;create&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;After an init timeout, move to a new Worker or a new page, with a guard against loops. Don't rebuild in place.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cutout tool this comes from: &lt;a href="https://koutuxia.com/?utm_source=devto" rel="noopener noreferrer"&gt;https://koutuxia.com/?utm_source=devto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I build Koutuxia.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>WebGPU ran our in-browser cutout 6x faster, and drew the wrong mask</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Tue, 20 Oct 2026 02:34:10 +0000</pubDate>
      <link>https://dev.to/szp2005/webgpu-ran-our-in-browser-cutout-6x-faster-and-drew-the-wrong-mask-3166</link>
      <guid>https://dev.to/szp2005/webgpu-ran-our-in-browser-cutout-6x-faster-and-drew-the-wrong-mask-3166</guid>
      <description>&lt;p&gt;Our background remover runs a BiRefNet model inside the visitor's browser with ONNX Runtime Web. For a while the free tier used WebGPU when it was there and fell back to WASM when it wasn't. That fallback rests on an assumption most of us make without thinking: same model, same answer, one backend is just quicker.&lt;/p&gt;

&lt;p&gt;On our model, with ORT-web 1.27, the assumption was false. WebGPU was fast and wrong, and none of our benchmarks noticed, because every one of them ran on CPU. We had never measured the path most visitors actually got.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it showed up
&lt;/h2&gt;

&lt;p&gt;I was checking a second matting pass in a real browser when the trimap's unknown region came out at about 95% of the image. Offline, the same image gave roughly 11%.&lt;/p&gt;

&lt;p&gt;So I took the same model bytes, the same input and the same page, ran it three ways, and logged the logits and where the alpha values landed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Weights + backend&lt;/th&gt;
&lt;th&gt;Lowest logit&lt;/th&gt;
&lt;th&gt;alpha &amp;lt;= 0.05&lt;/th&gt;
&lt;th&gt;Soft band&lt;/th&gt;
&lt;th&gt;Inference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;int8 + WASM&lt;/td&gt;
&lt;td&gt;-20.70&lt;/td&gt;
&lt;td&gt;76.0%&lt;/td&gt;
&lt;td&gt;0.8%&lt;/td&gt;
&lt;td&gt;16.8 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;int8 + WebGPU&lt;/td&gt;
&lt;td&gt;-5.34&lt;/td&gt;
&lt;td&gt;2.2%&lt;/td&gt;
&lt;td&gt;75.1%&lt;/td&gt;
&lt;td&gt;2.8 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fp32 + WebGPU&lt;/td&gt;
&lt;td&gt;-20.71&lt;/td&gt;
&lt;td&gt;76.0%&lt;/td&gt;
&lt;td&gt;0.8%&lt;/td&gt;
&lt;td&gt;3.7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The negative logits got squashed. Positive ones were mostly fine, so the subject still looked right, but the background lost its confidence and about three quarters of the frame slid into the semi-transparent band. On screen that passes for a "softer edge" until you score it against ground truth. Setting &lt;code&gt;graphOptimizationLevel&lt;/code&gt; to basic or disabled didn't save it (disabled was worse). fp32 on WebGPU matched WASM, which pointed at the int8 DequantizeLinear path in that backend, not at WebGPU as such.&lt;/p&gt;

&lt;p&gt;The finished cutouts confirmed it. We ran seven opaque objects from the AIM-500 set through the full production pipeline in a real browser, and WASM beat WebGPU on every one, with a median SAD of 1.10 against 6.15. We turned WebGPU off that day, September 13.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting the speed back without it
&lt;/h2&gt;

&lt;p&gt;Part of WASM's slowness was the same int8 weights. WASM has no integer acceleration, so dequantizing is extra work on every layer. Switching to fp16 weights brought 1024-input inference on the same image from 16.8 s down to 6.95 s, around 8 s end to end, which is roughly what WebGPU users had been seeing. The fp16 output matched fp32 closely; mean alpha difference was on the order of 1e-5.&lt;/p&gt;

&lt;p&gt;Getting a working fp16 file took a custom pass. The converter left one branch in fp32, ORT refused to create a session with mixed-type nodes, and we had to insert a Cast on every node that took both precisions until none were left.&lt;/p&gt;

&lt;p&gt;Then we tried that fp16 model on WebGPU, hoping to turn it back on. It failed the opposite way: the whole output collapsed to background, so the cutout was empty. For this model on this ORT-web version, fp32 was the only WebGPU configuration we found that computed correct numbers. &lt;code&gt;USE_WEBGPU&lt;/code&gt; is still &lt;code&gt;false&lt;/code&gt; in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  The check we run now
&lt;/h2&gt;

&lt;p&gt;When you change backends, compare the output distribution, not the timing. The raw logits go through a sigmoid to become alpha, so a few counters tell you whether two backends agree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// logits: Float32Array straight from session.run()&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;maskStats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;Infinity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="kc"&gt;Infinity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bg&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="n"&gt;soft&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;const&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;logits&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="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&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="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;a&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;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&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;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;x&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="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;bg&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;soft&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;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bg&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;logits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;soft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;soft&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;logits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the soft band jumps from around 1% to around 70%, the backend is computing a different function. It isn't being gentler with edges. Keep an fp32 build around as the referee. And create the session with exactly one provider, &lt;code&gt;executionProviders: ["webgpu"]&lt;/code&gt;, so a silent fallback can't report the wrong backend and send you chasing a ghost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this costs
&lt;/h2&gt;

&lt;p&gt;Going WASM-only gives up WebGPU's best case. In our telemetry from before the shutdown, warm WebGPU runs on 8 to 11 core desktops had a p50 near 1.6 s, though that was only three samples. Cold first cutouts were another story, since session creation alone could eat several seconds. The current default tier (WASM, 1024, fp16) isn't in the telemetry summary yet, so I can't show you today's real-device numbers for it.&lt;/p&gt;

&lt;p&gt;I also want to be clear about scope. This is one quantized model on ORT-web 1.27. It is not proof that WebGPU can't run quantized models; it's a reason to check value for value before you trust a speedup.&lt;/p&gt;

&lt;p&gt;The full real-device table, split by backend, device type and CPU cores, is on our own page: &lt;a href="https://koutuxia.com/en/guide/webgpu-vs-wasm-background-removal?utm_source=devto" rel="noopener noreferrer"&gt;https://koutuxia.com/en/guide/webgpu-vs-wasm-background-removal?utm_source=devto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I build Koutuxia.&lt;/p&gt;

</description>
      <category>performance</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Apple's on-device model called our iPhone 17 "not eligible", so we tested everything except the model</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Thu, 15 Oct 2026 02:31:57 +0000</pubDate>
      <link>https://dev.to/szp2005/apples-on-device-model-called-our-iphone-17-not-eligible-so-we-tested-everything-except-the-4i61</link>
      <guid>https://dev.to/szp2005/apples-on-device-model-called-our-iphone-17-not-eligible-so-we-tested-everything-except-the-4i61</guid>
      <description>&lt;p&gt;The first time I asked the on-device model whether it could run on a real phone, &lt;code&gt;SystemLanguageModel.default.availability&lt;/code&gt; answered &lt;code&gt;.unavailable(.deviceNotEligible)&lt;/code&gt;. The device was an iPhone 17 on iOS 26.6, which is new enough for Apple Intelligence. It was also bought in mainland China, where Apple Intelligence isn't offered, and as far as I can tell that is the whole reason.&lt;/p&gt;

&lt;p&gt;That was a problem. It was the night before I submitted an AI menu for CapScribe, my caption app: keyword emphasis, title suggestions and emoji, all generated on device. The one phone I own will never run it. The simulator can't run it either.&lt;/p&gt;

&lt;p&gt;So the honest version of this post is: here is how we shipped a Foundation Models feature we could not run, and what we tested instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gate has more than two states
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;availability&lt;/code&gt; isn't a Bool. When it's unavailable you get a reason, and the reasons deserve different copy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="kt"&gt;SystemLanguageModel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;availability&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;available&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;available&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;deviceNotEligible&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Device not eligible for Apple Intelligence"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;appleIntelligenceNotEnabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Apple Intelligence not enabled in Settings"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;modelNotReady&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Model is downloading or not ready"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;@unknown&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Model unavailable"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only one of those is permanent. "Not enabled" is a trip to Settings. "Not ready" usually means the model is still downloading and will sort itself out. Collapse them into a single "AI unavailable" string and you tell the user with a fixable problem that they're stuck, while the user with an ineligible phone learns nothing.&lt;/p&gt;

&lt;p&gt;My first instinct was to hide the menu whenever the model isn't there. I didn't. A missing button looks like a bug to anyone who read the release notes, and a hidden menu can't explain itself. What shipped: the menu always appears, the three actions are disabled, and a disabled row at the bottom says which case you're in.&lt;/p&gt;

&lt;h2&gt;
  
  
  A seam so the fallback can be tested
&lt;/h2&gt;

&lt;p&gt;The service takes an optional model behind a one-method protocol:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;protocol&lt;/span&gt; &lt;span class="kt"&gt;AssistantModel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Sendable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;throws&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a model is injected, the service sends it the prompt and decodes the JSON it returns. If not, it checks availability and either opens a &lt;code&gt;LanguageModelSession&lt;/code&gt; with a &lt;code&gt;@Generable&lt;/code&gt; output type or throws &lt;code&gt;.unavailable(reason)&lt;/code&gt;. The real path is short on purpose. The less code that only runs on hardware I don't have, the better.&lt;/p&gt;

&lt;p&gt;Unit tests inject a mock that records the prompt. That's where the input cap gets checked: transcripts are cut to 3,000 characters before they reach the model, and a test feeds a much longer string and asserts nothing past the cap made it into the prompt.&lt;/p&gt;

&lt;p&gt;UI tests can't inject anything, so there's a DEBUG-only launch argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="cp"&gt;#if DEBUG&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;makeFakeIfNeeded&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;OnDeviceAssistant&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kt"&gt;ProcessInfo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processInfo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-uitest-fake-assistant"&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;OnDeviceAssistant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;FakeAssistantModel&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;#endif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fake returns fixed JSON: a couple of keywords, three titles, one 🎬. With the flag set, a UI test runs all three actions in the editor. It checks that keyword emphasis gets switched on in the style panel, that three title rows appear, and that the emoji really lands at the end of the caption text. Without the flag, a second UI test opens the same menu in the simulator, where Foundation Models reports unavailable, and asserts the actions are disabled and the reason row exists and isn't empty.&lt;/p&gt;

&lt;p&gt;That second test is the one I care about most. On my own phone the unavailable path is the only path, and for plenty of users it will be too.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this doesn't cover
&lt;/h2&gt;

&lt;p&gt;The real model. Prompt quality, latency, whether &lt;code&gt;@Guide(.count(3))&lt;/code&gt; really yields three titles every time on a real device: none of that has run on hardware we own. The App Review notes spell out the device requirement, and real-model verification sits on our roadmap as blocked until we get an eligible phone.&lt;/p&gt;

&lt;p&gt;I went back and forth on shipping like that. What tipped it was proportion. The code that only runs on eligible hardware is a handful of lines handed straight to Apple's framework. The code that decides what everyone else sees runs on every build.&lt;/p&gt;

&lt;p&gt;If you're adding Foundation Models to an app, two things are worth doing on day one. Give each unavailability reason its own message, and put a protocol between your feature and &lt;code&gt;LanguageModelSession&lt;/code&gt;, so the fallback path gets tested in the simulator, where it's the default anyway.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I build CapScribe, an on-device caption app for iOS. The menu in question is in the editor: &lt;a href="https://apps.apple.com/app/id6801041856?utm_source=devto" rel="noopener noreferrer"&gt;https://apps.apple.com/app/id6801041856?utm_source=devto&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>swift</category>
      <category>ios</category>
      <category>ai</category>
      <category>testing</category>
    </item>
    <item>
      <title>One speed number lied about our in-browser cutout. We published the distribution instead.</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Tue, 13 Oct 2026 02:39:06 +0000</pubDate>
      <link>https://dev.to/szp2005/one-speed-number-lied-about-our-in-browser-cutout-we-published-the-distribution-instead-3151</link>
      <guid>https://dev.to/szp2005/one-speed-number-lied-about-our-in-browser-cutout-we-published-the-distribution-instead-3151</guid>
      <description>&lt;p&gt;Marketing loves a single millisecond. Real browser-side matting does not.&lt;/p&gt;

&lt;p&gt;We run BiRefNet locally in the visitor's browser so pixels never leave the device. That choice makes latency a property of &lt;em&gt;their&lt;/em&gt; machine: CPU class, WASM thread count, cold versus warm model cache. Quoting one lab laptop as "the" speed was the wrong default.&lt;/p&gt;

&lt;h2&gt;
  
  
  The wrong default
&lt;/h2&gt;

&lt;p&gt;Early pages said something like "about two seconds." That figure came from one desktop class on one model tier. Readers with fewer cores, cold caches, or mobile devices saw something else and assumed the product was broken. A single hero number hides the spread.&lt;/p&gt;

&lt;p&gt;We also tried enabling WebGPU as the "fast path." On ORT-web with our quantized weights, WebGPU did not merely run slower. It computed wrong masks. So &lt;code&gt;USE_WEBGPU&lt;/code&gt; stays false. The live path is WASM-only, fixed square input at the current tier, lite fp16 gzip around seventy-eight megabytes. Correctness first.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we ship instead
&lt;/h2&gt;

&lt;p&gt;We opened a public benchmarks page built from opted-in telemetry. Last ninety days hold about five hundred samples. Each row is a phase (download, cache hit, session create, first inference), backend, device class, and CPU bucket.&lt;/p&gt;

&lt;p&gt;Rules we follow on that page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show &lt;strong&gt;p50 and p95&lt;/strong&gt;, not a marketing minimum.&lt;/li&gt;
&lt;li&gt;Buckets with too few samples stay listed but greyed so absence of data is visible, not silently dropped.&lt;/li&gt;
&lt;li&gt;JSON and CSV are downloadable so anyone can recompute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One solid slice from the older mid-resolution quantized model (not the current larger fp16 tier): first inference on desktop WASM in the common eight-to-eleven-core bucket, with dozens of samples, sits near a two-second median. The same phase's p95 stretches past ten seconds.&lt;/p&gt;

&lt;p&gt;A nearby twelve-plus-core bucket shows a higher median around three and a half seconds. Cache hits land in tens of milliseconds; cold downloads sit in the multi-second range. Session create for those classes is roughly two seconds at the median.&lt;/p&gt;

&lt;p&gt;Those rows are historical mid-tier samples. The live product now serves the larger fp16 WASM build. We keep the older distribution public so the method stays honest while newer tiers accumulate past the display floor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost of this approach
&lt;/h2&gt;

&lt;p&gt;Publishing a distribution costs more words than a badge. It also costs the discipline not to cherry-pick. We accept grey cells and model-version labels instead of inventing a WebGPU "about one-point-seven seconds" story that our code does not run.&lt;/p&gt;

&lt;p&gt;The upside is boring and useful: when someone asks "how fast is it?", we can point at buckets that match their machine class, and they can download the same numbers we use.&lt;/p&gt;

&lt;p&gt;Live tables, greying rules, and downloads: &lt;a href="https://koutuxia.com/en/benchmarks?utm_source=devto" rel="noopener noreferrer"&gt;https://koutuxia.com/en/benchmarks?utm_source=devto&lt;/a&gt;. I built this tool (Koutuxia); the benchmarks page is our own telemetry, not a third-party lab.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>javascript</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Fixing one typo in a caption used to throw away the word timings for the whole line</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Thu, 08 Oct 2026 02:35:38 +0000</pubDate>
      <link>https://dev.to/szp2005/fixing-one-typo-in-a-caption-used-to-throw-away-the-word-timings-for-the-whole-line-3g3</link>
      <guid>https://dev.to/szp2005/fixing-one-typo-in-a-caption-used-to-throw-away-the-word-timings-for-the-whole-line-3g3</guid>
      <description>&lt;p&gt;CapScribe burns captions into video on the iPhone, and one of its caption styles highlights each word as it is spoken. That only works because the on-device transcriber hands back a start time and a duration for every word. Then someone fixes a typo, and you have to decide what happens to those timings.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looked like
&lt;/h2&gt;

&lt;p&gt;Until the 2.4 release, the answer was: they disappear. The edit handler set the segment's &lt;code&gt;words&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; and moved on.&lt;/p&gt;

&lt;p&gt;The renderer handles that case carefully. A segment with no word timings falls back to a static caption instead of inventing timings, and the editor shows a note saying so. That is honest, but from the user's side it is baffling. You correct "quik" to "quick", and the highlight on that line just stops. Fix a few typos across a video and a few lines go static.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not something simpler
&lt;/h2&gt;

&lt;p&gt;Re-running recognition every time someone edits one line is a lot of machinery for a typo. Spreading the segment's duration evenly over the new words is cheap, but it throws away good data. In a four-word line where one word changed, three of the timings are still exactly right, and anything that recomputes them can only make them worse.&lt;/p&gt;

&lt;p&gt;So the rule became: words the user didn't touch keep their timing byte for byte, and only the edited stretch gets new numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do now
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;WordTimingRealigner&lt;/code&gt; is a pure function. It takes the old words, the old text, the new text and the segment bounds, and returns new word timings or &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Step one is a word-level longest common subsequence between old and new tokens, compared case-insensitively, with punctuation dropped during tokenization. Matched words become anchors and are copied across unchanged, confidence included. That alone means editing "hello world" into "Hello, world!" returns the original array, and the unit test asserts equality on the whole thing.&lt;/p&gt;

&lt;p&gt;Step two fills the gaps. Each run of unmatched new tokens sits between two anchors, so it gets the window from the end of the previous anchor to the start of the next one, split by character count:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;totalChars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gapTokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&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="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&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="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;gapTokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enumerated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;dur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;gapTokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&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="n"&gt;winEnd&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;   &lt;span class="c1"&gt;// last token absorbs rounding&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;winDuration&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tok&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;totalChars&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;gapStart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;WordTiming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dur&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;confidence&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;dur&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generated words get &lt;code&gt;confidence: nil&lt;/code&gt;, so nothing downstream mistakes a guess for recognizer output. The last token in a gap takes whatever time is left, so floating-point drift can't push it into its neighbour.&lt;/p&gt;

&lt;p&gt;Two details took longer than the algorithm itself.&lt;/p&gt;

&lt;p&gt;The LCS table is built from the suffix end, which lets the backtrack walk forward. When a word repeats ("the cat saw the dog"), it takes the earliest match that still keeps the subsequence maximal, so the same edit always produces the same anchors.&lt;/p&gt;

&lt;p&gt;Chinese has no spaces, and the stored words might be whole words or single characters. Before matching, the function checks whether the stored words agree with &lt;code&gt;enumerateSubstrings(byWords)&lt;/code&gt; or with a one-token-per-character split, and tokenizes the new text the same way. If neither agrees, it doesn't guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it gives up
&lt;/h2&gt;

&lt;p&gt;It returns &lt;code&gt;nil&lt;/code&gt;, and that segment falls back to a static caption, when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;nothing matches at all (the line was rewritten),&lt;/li&gt;
&lt;li&gt;the stored words don't validate against the old text, overlap each other, or fall outside the segment,&lt;/li&gt;
&lt;li&gt;an insertion lands between two anchors that touch with zero gap, so there is no window to put the new word in.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last case is a real limitation. If the recognizer reported two words back to back and you insert a word between them, that line still loses its highlight. Borrowing time from the neighbours would fix it, but it breaks the rule that untouched words never move, and I would rather show a static line than shift a correct timestamp.&lt;/p&gt;

&lt;p&gt;The output is checked again before it is returned: right count, every duration positive, monotonic, inside the segment. A property test runs 50 seeded random edits (replace, insert, delete, punctuation) and asserts those invariants whenever the result isn't &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cost
&lt;/h2&gt;

&lt;p&gt;Splitting by characters is a guess. A long word does not take proportionally longer to say than a short one, so the highlight on a changed word can land visibly early or late. For a typo fix inside one word, the guess is boxed in by the anchors on both sides, so the error can't spread past that word's old window plus any silence around it. Bigger rewrites get less precise, and a full rewrite gets nothing, which is the point.&lt;/p&gt;

&lt;p&gt;The table is O(M×N) per edit. That is fine for a caption line and not something I would run over a whole transcript.&lt;/p&gt;




&lt;p&gt;I build CapScribe, an iOS app that transcribes and burns in captions on the device: &lt;a href="https://apps.apple.com/app/id6801041856?utm_source=devto" rel="noopener noreferrer"&gt;CapScribe on the App Store&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>swift</category>
      <category>ios</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Our IP score knows this is iCloud Private Relay and still rates it like a paid VPN</title>
      <dc:creator>szp2005</dc:creator>
      <pubDate>Wed, 30 Sep 2026 02:08:02 +0000</pubDate>
      <link>https://dev.to/szp2005/our-ip-score-knows-this-is-icloud-private-relay-and-still-rates-it-like-a-paid-vpn-26ei</link>
      <guid>https://dev.to/szp2005/our-ip-score-knows-this-is-icloud-private-relay-and-still-rates-it-like-a-paid-vpn-26ei</guid>
      <description>&lt;p&gt;Paste 104.28.28.5 into our IP checker and you get 65 out of 100, amber, with a &lt;code&gt;relay&lt;/code&gt; tag sitting next to &lt;code&gt;vpn&lt;/code&gt; and &lt;code&gt;proxy&lt;/code&gt;. Paste a Mullvad WireGuard exit in Atlanta and you get the same score. One is an Apple egress carrying ordinary Safari traffic from people who flipped a switch in their iCloud settings. The other is a node on a VPN people pay for.&lt;/p&gt;

&lt;p&gt;It looks like a bug. We looked at it as one, and then decided to keep it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the vendors actually return
&lt;/h2&gt;

&lt;p&gt;Our score is a weighted average across a set of reputation sources, plus hard floors. The floor that matters here: if enough dedicated sources vote proxy or VPN, the score can't drop below 65. "Dedicated" means everyone except ip-api, whose flags are coarse booleans. For an address that already sits in a datacenter, "enough" means two votes, because a lone proxy flag on cloud space is usually one vendor painting a whole range.&lt;/p&gt;

&lt;p&gt;On the Apple address, three sources voted: Scamalytics, proxycheck and vpnapi.io. The odd part is what two of them said next to the vote. Scamalytics returned &lt;code&gt;is_apple_icloud_private_relay: true&lt;/code&gt; and flagged the IP as a VPN in the same response. vpnapi.io returned &lt;code&gt;relay: true&lt;/code&gt; and &lt;code&gt;vpn: true&lt;/code&gt; together. So they know exactly what this address is, and they still call it a VPN.&lt;/p&gt;

&lt;p&gt;You can check it yourself, no key needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s1"&gt;'https://ipok.io/api/ip?ip=104.28.28.5'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | jq &lt;span class="s1"&gt;'{risk, signals, evidence, floors: .riskBreakdown.floors}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The weighted average of the individual source scores comes out around 30. The floor is what drags it up to 65.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we tried
&lt;/h2&gt;

&lt;p&gt;The first fix was the obvious one. We already detect relay: Apple publishes its egress ranges and we load them into our offline list, and IPHub and vpnapi.io both expose a relay field. So exempt relay IPs from the VPN floor and move on.&lt;/p&gt;

&lt;p&gt;We shipped half of that. Relay now exempts an IP from the hosting floor of 35, which exists because datacenter traffic gets treated with more suspicion even when nothing specific is wrong with the address. That floor was plainly wrong for Private Relay. The exit is in Cloudflare's address space, but there's a normal person behind every connection. Our own offline list also stopped casting a VPN vote on those ranges.&lt;/p&gt;

&lt;p&gt;Dropping the 65 was a different question. The score isn't a verdict on whether the person behind the IP is up to something. It's a forecast of how other services will treat the address. Any site that asks one of those same vendors gets "VPN" back, relay or not. If we removed the floor, we'd be overruling three vendors whose verdicts other sites may well be reading. The score would look friendlier and predict worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do now
&lt;/h2&gt;

&lt;p&gt;The decision sits in the code, right next to the check, so nobody "fixes" it later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isRelay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relay&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Relay only exempts the hosting floor, NOT the 65 proxyVpn floor.&lt;/span&gt;
&lt;span class="c1"&gt;// The score describes how the outside world treats this IP,&lt;/span&gt;
&lt;span class="c1"&gt;// and many services really do block iCloud Private Relay.&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hosting&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&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;hasTrustedWhitelist&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;isRelay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;floors&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;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hosting&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;contextual&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The comment is translated; the original is in Chinese.)&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;relay&lt;/code&gt; tag in the result is the explanation, and the methodology page has a paragraph saying the same thing in plain language.&lt;/p&gt;

&lt;p&gt;This has a cost. The headline number can't tell "you turned on an Apple privacy feature" apart from "you're on a paid VPN". If that difference matters to you, you have to look for &lt;code&gt;relay&lt;/code&gt; in &lt;code&gt;signals&lt;/code&gt;, or open the per-source raw fields and read Scamalytics' relay boolean yourself. We accepted that. The alternative is a score that disagrees with the vendors doing the actual blocking, which would make it wrong about the one thing it is supposed to predict.&lt;/p&gt;

&lt;p&gt;If you run any kind of reputation scoring, it's worth deciding which of the two your number is: a judgment about the user, or a prediction of how others will judge them. We went with the prediction, and Private Relay is where that choice feels worst to explain to a user.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I built &lt;a href="https://ipok.io" rel="noopener noreferrer"&gt;ipok&lt;/a&gt;, the checker used in the examples above.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>networking</category>
      <category>privacy</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
