<?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: Todd Tanner</title>
    <description>The latest articles on DEV Community by Todd Tanner (@lostbeard).</description>
    <link>https://dev.to/lostbeard</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%2F3764795%2Ff44abd5a-147e-40af-88c4-7a48ad30cee7.png</url>
      <title>DEV Community: Todd Tanner</title>
      <link>https://dev.to/lostbeard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lostbeard"/>
    <language>en</language>
    <item>
      <title>Run an AI model in Blazor with no server and no API key</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Thu, 26 Nov 2026 01:38:14 +0000</pubDate>
      <link>https://dev.to/lostbeard/run-an-ai-model-in-blazor-with-no-server-and-no-api-key-33l1</link>
      <guid>https://dev.to/lostbeard/run-an-ai-model-in-blazor-with-no-server-and-no-api-key-33l1</guid>
      <description>&lt;p&gt;&lt;a href="https://lostbeard.github.io/SpawnDev.Examples/ImageAI/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; | &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/tree/main/ImageAI" rel="noopener noreferrer"&gt;Full example on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adding AI to an app often means an account, an API key, a bill for every request, and sending your users' data to someone else's server.&lt;/p&gt;

&lt;p&gt;For many jobs you need none of that. A small model can run on the visitor's own device, in the browser, from C#.&lt;/p&gt;

&lt;p&gt;We will build a page that names what is in a photo. The photo is never uploaded. You need the .NET 10 SDK and a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model
&lt;/h2&gt;

&lt;p&gt;A model is a file. This one is MobileNetV2, a 14 MB image recognition network from the ONNX Model Zoo (Apache-2.0). It knows 1,000 kinds of things, from dog breeds to kitchen tools.&lt;/p&gt;

&lt;p&gt;SpawnDev.ILGPU.ML reads the file and runs it on the GPU. It uses WebGPU when the browser has it, then WebGL, then WebAssembly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new blazorwasm -o ImageAI --empty
&lt;span class="nb"&gt;cd&lt;/span&gt; ImageAI
dotnet add package SpawnDev.ILGPU.ML
dotnet add package SpawnDev.SpawnJS
dotnet add package SpawnDev.SpawnJS.Blazor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download &lt;a href="https://huggingface.co/onnxmodelzoo/mobilenetv2-7/resolve/main/mobilenetv2-7.onnx" rel="noopener noreferrer"&gt;mobilenetv2-7.onnx&lt;/a&gt; into &lt;code&gt;wwwroot&lt;/code&gt;. For the sample buttons, also save &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/blob/main/ImageAI/wwwroot/red-panda.jpg" rel="noopener noreferrer"&gt;red-panda.jpg&lt;/a&gt; and &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/blob/main/ImageAI/wwwroot/labrador.jpg" rel="noopener noreferrer"&gt;labrador.jpg&lt;/a&gt; there.&lt;/p&gt;

&lt;p&gt;Replace &lt;code&gt;Program.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;ImageAI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AspNetCore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Components&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebAssembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hosting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WebAssemblyHostBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootComponents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddSpawnJSRuntime&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&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="nc"&gt;SpawnJSRunAsync&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;Add these lines to &lt;code&gt;_Imports.razor&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@using SpawnDev.SpawnJS
@using SpawnDev.SpawnJS.JSObjects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Load the model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;LoadModel&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;classifier&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&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;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Loading the model..."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;StateHasChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MLContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllAcceleratorsAsync&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="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToContext&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="n"&gt;accelerator&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;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreatePreferredAcceleratorAsync&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;await&lt;/span&gt; &lt;span class="nc"&gt;LoadSavedShaders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// The browser downloads the model into its own storage, and the weights go from there to the GPU.&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;hub&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ModelHub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stream&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;hub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OpenStreamFromUrlAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AppBaseUri&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"mobilenetv2-7.onnx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"this browser has no storage for the model"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;InferenceSession&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateFromStreamAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;classifier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ClassificationPipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accelerator&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;The model is loaded when the first photo arrives, so visitors who only look at the page do not download it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ModelHub&lt;/code&gt; has the browser download the model into its own storage. The session reads the weights from there and sends them to the GPU, without making the model a .NET array. The next visit uses the stored copy.&lt;/p&gt;

&lt;p&gt;This matters. We first wrote this page with &lt;code&gt;HttpClient&lt;/code&gt;, which brings the whole model into .NET:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;How the model is loaded&lt;/th&gt;
&lt;th&gt;.NET memory allocated while loading&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HttpClient&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;82 to 97 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ModelHub&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2.9 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you change the model, give the file a new name. A stored copy is found by its address and is not checked again.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ClassificationPipeline&lt;/code&gt; does the rest of the work around the model: it resizes the photo, prepares the colors, and turns the numbers that come out into names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the pixels
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The browser decodes the photo. Its pixels go to the GPU without becoming a .NET array.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ImageData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;GetPixels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt; &lt;span class="n"&gt;photo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Window&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;bitmap&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;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateImageBitmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;photo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HTMLCanvasElement&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="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;drawing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Get2DContext&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="n"&gt;drawing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DrawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bitmap&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Height&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="n"&gt;drawing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetImageData&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Height&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;The browser already knows how to read JPEG, PNG and WebP files, so we let it. The pixels stay in the browser's memory on their way to the GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask the model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;Look&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt; &lt;span class="n"&gt;photo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;busy&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="n"&gt;answers&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="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;ShowPhoto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;photo&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="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;LoadModel&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="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;firstPhoto&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;"Getting the GPU ready. First photo only..."&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Looking..."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nc"&gt;StateHasChanged&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;await&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// let the page draw&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;GetPixels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;photo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Stopwatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StartNew&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="n"&gt;answers&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;classifier&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ClassifyAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;topK&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Done in {timer.ElapsedMilliseconds} ms on {accelerator!.AcceleratorType}{(firstPhoto ? "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;including&lt;/span&gt; &lt;span class="n"&gt;getting&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="no"&gt;GPU&lt;/span&gt; &lt;span class="n"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nc"&gt;Try&lt;/span&gt; &lt;span class="n"&gt;another&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;" : "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;")}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstPhoto&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;SaveShaders&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="n"&gt;firstPhoto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"That did not work: {ex.Message}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;busy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ClassifyAsync&lt;/code&gt; takes the pixels and returns the best guesses, each with a label and a confidence.&lt;/p&gt;

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

&lt;p&gt;For the two sample photos:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Photo&lt;/th&gt;
&lt;th&gt;First guess&lt;/th&gt;
&lt;th&gt;Second guess&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Red panda&lt;/td&gt;
&lt;td&gt;lesser panda, 100%&lt;/td&gt;
&lt;td&gt;polecat, 0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Labrador&lt;/td&gt;
&lt;td&gt;Labrador retriever, 71%&lt;/td&gt;
&lt;td&gt;golden retriever, 28%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Lesser panda" is another name for the red panda.&lt;/p&gt;

&lt;p&gt;How long it took on one PC with an RTX 4070, in Chrome with WebGPU:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First photo, first visit&lt;/td&gt;
&lt;td&gt;about 9 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First photo, next visit&lt;/td&gt;
&lt;td&gt;about 1.6 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every photo after that&lt;/td&gt;
&lt;td&gt;about 0.05 to 0.1 seconds for the model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first photo includes loading the model and preparing it for your GPU, so the page says so while you wait. Your times will differ.&lt;/p&gt;

&lt;p&gt;Browsers without WebGPU use WebGL or WebAssembly instead. On the same PC with WebGL, the model took about 1.5 to 1.7 seconds for the first photo and about 0.3 seconds for each one after it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the next visit faster
&lt;/h2&gt;

&lt;p&gt;Preparing the GPU means turning C# kernels into shader code. With WebGPU you can save that code in the browser after the first photo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;SaveShaders&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;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;folder&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;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDirectory&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;handle&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;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFileHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ShaderFile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create&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="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;target&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateWritable&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;await&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ShaderArtifactSerializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ExportCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c1"&gt;// storage is full or blocked: only the next visit is slower&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And load it on the next visit, before the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;LoadSavedShaders&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;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;folder&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;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDirectory&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;handle&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;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFileHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ShaderFile&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;file&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFile&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="nc"&gt;ShaderArtifactSerializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ImportCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c1"&gt;// nothing saved yet, or it cannot be used: the shaders are generated as usual&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our test this took the first photo of a return visit from about 4 seconds to about 1.6. If you update the library, the saved code is ignored and made again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to know first
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It can be wrong.&lt;/strong&gt; A model always answers, even for things it has never seen. Show the confidence, and do not use it for decisions that matter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The visitor downloads the model.&lt;/strong&gt; 14 MB is fine for many apps. Larger models need a progress bar and a good reason.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can change the model.&lt;/strong&gt; SpawnDev.ILGPU.ML also runs models for finding objects, removing backgrounds, speech, text and images.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The whole page
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;Pages/Home.razor&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@page "/"
@using System.Diagnostics
@using ILGPU
@using ILGPU.Runtime
@using SpawnDev.ILGPU
@using SpawnDev.ILGPU.ML
@using SpawnDev.ILGPU.ML.Hub
@using SpawnDev.ILGPU.ML.Pipelines
@inject SpawnJSRuntime JS
@implements IDisposable

&amp;lt;main&amp;gt;
    &amp;lt;h1&amp;gt;What is in this photo?&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;The AI model runs on this device. Your photo is not uploaded anywhere. The first photo takes longer: it downloads the model (14 MB) and gets your GPU ready for it.&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label&amp;gt;Your photo: &amp;lt;input id="pick" type="file" accept="image/*" disabled="@busy" @onchange="UseChosenPhoto" /&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;button id="panda" disabled="@busy" @onclick='() =&amp;gt; UseSample("red-panda.jpg")'&amp;gt;Try a red panda&amp;lt;/button&amp;gt;
    &amp;lt;button id="dog" disabled="@busy" @onclick='() =&amp;gt; UseSample("labrador.jpg")'&amp;gt;Try a dog&amp;lt;/button&amp;gt;
    &amp;lt;p id="status" role="status"&amp;gt;@status&amp;lt;/p&amp;gt;
    @if (photoUrl is not null)
    {
        &amp;lt;img src="@photoUrl" alt="The photo being looked at" /&amp;gt;
    }
    &amp;lt;ol id="answers"&amp;gt;
        @foreach (var answer in answers)
        {
            &amp;lt;li&amp;gt;@answer.Label: @answer.Confidence.ToString("P0")&amp;lt;/li&amp;gt;
        }
    &amp;lt;/ol&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Sample photos: Wikimedia Commons, CC0. Model: MobileNetV2 from the ONNX Model Zoo, Apache-2.0.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/main&amp;gt;

@code {
    bool busy;
    bool firstPhoto = true;
    string status = "";
    string? photoUrl;
    ClassificationResult[] answers = [];
    Context? context;
    Accelerator? accelerator;
    InferenceSession? session;
    ClassificationPipeline? classifier;

    async Task LoadModel()
    {
        if (classifier is not null) return;
        status = "Loading the model...";
        StateHasChanged();
        var builder = MLContext.Create();
        await builder.AllAcceleratorsAsync();
        context = builder.ToContext();
        accelerator = await context.CreatePreferredAcceleratorAsync();
        await LoadSavedShaders();
        // The browser downloads the model into its own storage, and the weights go from there to the GPU.
        using var hub = new ModelHub(JS);
        using var stream = await hub.OpenStreamFromUrlAsync(JS.AppBaseUri + "mobilenetv2-7.onnx")
            ?? throw new Exception("this browser has no storage for the model");
        session = await InferenceSession.CreateFromStreamAsync(accelerator, stream);
        classifier = new ClassificationPipeline(session, accelerator);
    }

    async Task Look(Blob photo)
    {
        busy = true;
        answers = [];
        ShowPhoto(photo);
        try
        {
            await LoadModel();
            status = firstPhoto ? "Getting the GPU ready. First photo only..." : "Looking...";
            StateHasChanged();
            await Task.Delay(50); // let the page draw
            using var pixels = await GetPixels(photo);
            using var data = pixels.Data;
            var timer = Stopwatch.StartNew();
            answers = await classifier!.ClassifyAsync(data, pixels.Width, pixels.Height, topK: 3);
            status = $"Done in {timer.ElapsedMilliseconds} ms on {accelerator!.AcceleratorType}{(firstPhoto ? ", including getting the GPU ready. Try another." : ".")}";
            if (firstPhoto) await SaveShaders();
            firstPhoto = false;
        }
        catch (Exception ex)
        {
            status = $"That did not work: {ex.Message}";
        }
        busy = false;
    }

    // Getting a WebGPU device ready means generating shader code. Keep it, so the next visit starts faster.
    const string ShaderFile = "shaders.json";

    async Task LoadSavedShaders()
    {
        try
        {
            using var navigator = new Navigator();
            using var storage = navigator.Storage;
            using var folder = await storage.GetDirectory();
            using var handle = await folder.GetFileHandle(ShaderFile);
            using var file = await handle.GetFile();
            ShaderArtifactSerializer.ImportCache(await file.Text());
        }
        catch { } // nothing saved yet, or it cannot be used: the shaders are generated as usual
    }

    async Task SaveShaders()
    {
        try
        {
            using var navigator = new Navigator();
            using var storage = navigator.Storage;
            using var folder = await storage.GetDirectory();
            using var handle = await folder.GetFileHandle(ShaderFile, create: true);
            using var target = await handle.CreateWritable();
            await target.Write(ShaderArtifactSerializer.ExportCache());
            await target.Close();
        }
        catch { } // storage is full or blocked: only the next visit is slower
    }

    // The browser decodes the photo. Its pixels go to the GPU without becoming a .NET array.
    async Task&amp;lt;ImageData&amp;gt; GetPixels(Blob photo)
    {
        using var window = new Window();
        using var bitmap = await window.CreateImageBitmap(photo);
        using var canvas = new HTMLCanvasElement();
        canvas.Width = (int)bitmap.Width;
        canvas.Height = (int)bitmap.Height;
        using var drawing = canvas.Get2DContext();
        drawing.DrawImage(bitmap, 0, 0, canvas.Width, canvas.Height);
        return drawing.GetImageData(0, 0, canvas.Width, canvas.Height);
    }

    async Task UseChosenPhoto()
    {
        using var document = JS.GetDocument()!;
        using var input = document.GetElementById&amp;lt;HTMLInputElement&amp;gt;("pick")!;
        using var files = input.Files;
        using var photo = files?.FirstOrDefault();
        if (photo is not null) await Look(photo);
    }

    async Task UseSample(string url)
    {
        using var response = await JS.Fetch(url);
        using var photo = await response.Blob();
        await Look(photo);
    }

    void ShowPhoto(Blob photo)
    {
        if (photoUrl is not null) URL.RevokeObjectURL(photoUrl);
        photoUrl = URL.CreateObjectURL(photo);
    }

    public void Dispose()
    {
        if (photoUrl is not null) URL.RevokeObjectURL(photoUrl);
        classifier?.Dispose();
        session?.Dispose();
        accelerator?.Dispose();
        context?.Dispose();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;dotnet run&lt;/code&gt; in your project, or clone the finished one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/LostBeard/SpawnDev.Examples
&lt;span class="nb"&gt;cd&lt;/span&gt; SpawnDev.Examples/ImageAI
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>blazor</category>
      <category>ai</category>
    </item>
    <item>
      <title>Your first GPU kernel in C#, in the browser and on the desktop</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Wed, 25 Nov 2026 16:31:56 +0000</pubDate>
      <link>https://dev.to/lostbeard/your-first-gpu-kernel-in-c-in-the-browser-and-on-the-desktop-4gb3</link>
      <guid>https://dev.to/lostbeard/your-first-gpu-kernel-in-c-in-the-browser-and-on-the-desktop-4gb3</guid>
      <description>&lt;p&gt;&lt;a href="https://lostbeard.github.io/SpawnDev.Examples/GpuKernel/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; | &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/tree/main/GpuKernel" rel="noopener noreferrer"&gt;Full example on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some work is the same small calculation, repeated for every pixel or every item. A CPU does those a few at a time. A GPU does thousands at once.&lt;/p&gt;

&lt;p&gt;Using the GPU usually means learning a second language for shaders, and a different one for the browser than for the desktop. With SpawnDev.ILGPU you write the calculation as a C# method. The same file runs in a Blazor app and in a desktop app.&lt;/p&gt;

&lt;p&gt;We will draw a fractal, the Mandelbrot set, on the page and on the GPU, then run the same code in a console app. You need the .NET 10 SDK and a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The kernel
&lt;/h2&gt;

&lt;p&gt;A kernel is a method the GPU runs once for every item, in our case every pixel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="no"&gt;ILGPU&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="no"&gt;ILGPU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nc"&gt;GpuKernel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Mandelbrot&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;The kernel: the GPU runs this once for every pixel.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Kernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Index2D&lt;/span&gt; &lt;span class="n"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ArrayView2D&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Stride2D&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DenseX&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;maxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Extent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Extent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Plain C#: the color of one pixel.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;maxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;cx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;3.0f&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;2.2f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;cy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;2.4f&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;1.2f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;zx&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;zy&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;maxSteps&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&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="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;zy&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;zx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;maxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mh"&gt;0xFF000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// inside the set: black&lt;/span&gt;
        &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;shade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;255&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="mh"&gt;0xFF000000&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;shade&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;shade&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;40&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;&lt;code&gt;Kernel&lt;/code&gt; receives the pixel it should work on, the image to write to, and a setting. &lt;code&gt;Color&lt;/code&gt; is ordinary C#, which is why we can also call it from the page and compare.&lt;/p&gt;

&lt;p&gt;Kernels have some limits. They work with numbers and structs, and they cannot create objects, use strings or throw exceptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new blazorwasm -o GpuKernel --empty
&lt;span class="nb"&gt;cd&lt;/span&gt; GpuKernel
dotnet add package SpawnDev.ILGPU
dotnet add package SpawnDev.SpawnJS
dotnet add package SpawnDev.SpawnJS.Blazor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the class above as &lt;code&gt;Mandelbrot.cs&lt;/code&gt;, then replace &lt;code&gt;Program.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;GpuKernel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AspNetCore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Components&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebAssembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hosting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WebAssemblyHostBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootComponents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddSpawnJSRuntime&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&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="nc"&gt;SpawnJSRunAsync&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;Add these lines to &lt;code&gt;_Imports.razor&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@using SpawnDev.SpawnJS
@using SpawnDev.SpawnJS.JSObjects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get the GPU ready
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;SetUpGpu&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;kernel&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&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;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllAcceleratorsAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;accelerator&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;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreatePreferredAcceleratorAsync&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="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Allocate2DDenseX&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Index2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Height&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="n"&gt;kernel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LoadAutoGroupedStreamKernel&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Index2D&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ArrayView2D&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Stride2D&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DenseX&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Mandelbrot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Kernel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CanvasRendererFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Call&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;HTMLCanvasElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"document.getElementById"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"canvas"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AttachCanvas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// The first run also compiles the kernel for this GPU, so do it once before timing.&lt;/span&gt;
    &lt;span class="nf"&gt;kernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IntExtent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SynchronizeAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CreatePreferredAcceleratorAsync&lt;/code&gt; picks the best option the browser has: WebGPU, then WebGL, then WebAssembly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Allocate2DDenseX&lt;/code&gt; reserves memory for the image on the GPU.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LoadAutoGroupedStreamKernel&lt;/code&gt; compiles the C# method for that GPU.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;DrawOnGpu&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;await&lt;/span&gt; &lt;span class="nc"&gt;Start&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;await&lt;/span&gt; &lt;span class="nc"&gt;SetUpGpu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Stopwatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StartNew&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="n"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IntExtent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SynchronizeAsync&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="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Stop&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;await&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PresentAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;Finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="s2"&gt;"GPU ({accelerator.AcceleratorType}): {timer.Elapsed.TotalMilliseconds:F0} ms"&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;Calling the kernel queues the work, and &lt;code&gt;SynchronizeAsync&lt;/code&gt; waits for it to finish. In the browser, always wait this way. &lt;code&gt;PresentAsync&lt;/code&gt; then shows the image on the canvas.&lt;/p&gt;

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

&lt;p&gt;800,000 pixels, on one PC with an RTX 4070:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;On the page (Chrome)&lt;/td&gt;
&lt;td&gt;about 800 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU, WebGPU (Chrome)&lt;/td&gt;
&lt;td&gt;1 to 5 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU, WebGL (Chrome)&lt;/td&gt;
&lt;td&gt;13 to 18 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The GPU times leave out the one-time setup and the first run, which compiles the kernel. Your times will differ, and your browser may pick a different option.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same kernel on the desktop
&lt;/h2&gt;

&lt;p&gt;A console app can use the same &lt;code&gt;Mandelbrot.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new console -o GpuKernel.Desktop
&lt;span class="nb"&gt;cd&lt;/span&gt; GpuKernel.Desktop
dotnet add package SpawnDev.ILGPU
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy &lt;code&gt;Mandelbrot.cs&lt;/code&gt; into it and replace &lt;code&gt;Program.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Diagnostics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;GpuKernel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="no"&gt;ILGPU&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="no"&gt;ILGPU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ILGPU&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;Width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllAcceleratorsAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;accelerator&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;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreatePreferredAcceleratorAsync&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Allocate2DDenseX&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Index2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;kernel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LoadAutoGroupedStreamKernel&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Index2D&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ArrayView2D&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Stride2D&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DenseX&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Mandelbrot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Kernel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// The first run also compiles the kernel for this GPU, so do it once before timing.&lt;/span&gt;
&lt;span class="nf"&gt;kernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IntExtent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SynchronizeAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Stopwatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StartNew&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="nf"&gt;kernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IntExtent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SynchronizeAsync&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="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Stop&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="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="s2"&gt;"{accelerator.AcceleratorType} ({accelerator.Name}): {timer.Elapsed.TotalMilliseconds:F1} ms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Same method, plain C#, one thread.&lt;/span&gt;
&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;y&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;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;x&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;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nc"&gt;Width&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;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;Width&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="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Mandelbrot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MaxSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Stop&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="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="s2"&gt;"One CPU thread: {timer.Elapsed.TotalMilliseconds:F1} ms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetAsArray2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;same&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;var&lt;/span&gt; &lt;span class="n"&gt;y&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;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nc"&gt;Height&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;x&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;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nc"&gt;Width&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;++&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;pixels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;Width&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="n"&gt;same&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="s2"&gt;"Matching pixels: {100.0 * same / expected.Length:F2}%"&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;On the same PC this printed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cuda (NVIDIA GeForce RTX 4070): 0.4 ms
One CPU thread: 218.5 ms
Matching pixels: 100.00%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The kernel uses &lt;code&gt;float&lt;/code&gt;, and this picture matched exactly. Do not count on that for every kernel: GPUs can round slightly differently. If you use &lt;code&gt;double&lt;/code&gt;, the browser backends emulate it. The default is fast but not exact, and &lt;code&gt;F64EmulationMode.Ieee&lt;/code&gt; gives the same results as .NET at a cost in speed.&lt;/p&gt;

&lt;p&gt;Without an NVIDIA card it uses OpenCL, or a CPU backend when there is no GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  When a GPU helps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Good fit:&lt;/strong&gt; work that can be split into many small pieces that run at the same time. Images, physics, simulations, video codecs and neural networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poor fit:&lt;/strong&gt; work that cannot be split up well, or too little work to make up for moving the data to the GPU and back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Work with many steps is fine, as long as each step can be split up. Neural networks and video codecs run one kernel after another, and the data stays on the GPU between steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole page
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;Pages/Home.razor&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@page "/"
@using System.Diagnostics
@using ILGPU
@using ILGPU.Runtime
@using SpawnDev.ILGPU
@using SpawnDev.ILGPU.Rendering
@inject SpawnJSRuntime JS
@implements IDisposable

&amp;lt;main&amp;gt;
    &amp;lt;h1&amp;gt;Who draws it faster?&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;Both buttons run the same C# method for every one of @((Width * Height).ToString("N0")) pixels. One runs it on the page, one on your GPU.&amp;lt;/p&amp;gt;
    &amp;lt;button id="cpu" disabled="@busy" @onclick="DrawOnPage"&amp;gt;Draw on the page&amp;lt;/button&amp;gt;
    &amp;lt;button id="gpu" disabled="@busy" @onclick="DrawOnGpu"&amp;gt;Draw on the GPU&amp;lt;/button&amp;gt;
    &amp;lt;p id="result" role="status"&amp;gt;@result&amp;lt;/p&amp;gt;
    &amp;lt;canvas id="canvas" width="@Width" height="@Height"&amp;gt;&amp;lt;/canvas&amp;gt;
&amp;lt;/main&amp;gt;

@code {
    const int Width = 1000, Height = 800, MaxSteps = 500;
    bool busy;
    string result = "";
    Context? context;
    Accelerator? accelerator;
    ICanvasRenderer? renderer;
    MemoryBuffer2D&amp;lt;uint, Stride2D.DenseX&amp;gt;? image;
    Action&amp;lt;Index2D, ArrayView2D&amp;lt;uint, Stride2D.DenseX&amp;gt;, int&amp;gt;? kernel;

    async Task SetUpGpu()
    {
        if (kernel is not null) return;
        context = await Context.CreateAsync(builder =&amp;gt; builder.AllAcceleratorsAsync());
        accelerator = await context.CreatePreferredAcceleratorAsync();
        image = accelerator.Allocate2DDenseX&amp;lt;uint&amp;gt;(new Index2D(Width, Height));
        kernel = accelerator.LoadAutoGroupedStreamKernel&amp;lt;Index2D, ArrayView2D&amp;lt;uint, Stride2D.DenseX&amp;gt;, int&amp;gt;(Mandelbrot.Kernel);
        renderer = CanvasRendererFactory.Create(accelerator);
        using var canvas = JS.Call&amp;lt;string, HTMLCanvasElement&amp;gt;("document.getElementById", "canvas");
        renderer.AttachCanvas(canvas);
        // The first run also compiles the kernel for this GPU, so do it once before timing.
        kernel(image.IntExtent, image.View, MaxSteps);
        await accelerator.SynchronizeAsync();
    }

    async Task DrawOnGpu()
    {
        await Start();
        await SetUpGpu();
        var timer = Stopwatch.StartNew();
        kernel!(image!.IntExtent, image.View, MaxSteps);
        await accelerator!.SynchronizeAsync();
        timer.Stop();
        await renderer!.PresentAsync(image);
        Finish($"GPU ({accelerator.AcceleratorType}): {timer.Elapsed.TotalMilliseconds:F0} ms");
    }

    async Task DrawOnPage()
    {
        await Start();
        await SetUpGpu(); // only to show the finished picture
        var timer = Stopwatch.StartNew();
        var pixels = new uint[Width * Height];
        for (var y = 0; y &amp;lt; Height; y++)
            for (var x = 0; x &amp;lt; Width; x++)
                pixels[y * Width + x] = Mandelbrot.Color(x, y, Width, Height, MaxSteps);
        timer.Stop();
        image!.View.BaseView.CopyFromCPU(pixels);
        await renderer!.PresentAsync(image);
        Finish($"Page: {timer.Elapsed.TotalMilliseconds:F0} ms");
    }

    async Task Start()
    {
        busy = true;
        result = "Drawing...";
        await Task.Delay(50); // let the page draw
    }

    void Finish(string message)
    {
        result = message;
        busy = false;
    }

    public void Dispose()
    {
        image?.Dispose();
        renderer?.Dispose();
        accelerator?.Dispose();
        context?.Dispose();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get the finished projects
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/LostBeard/SpawnDev.Examples
&lt;span class="nb"&gt;cd&lt;/span&gt; SpawnDev.Examples/GpuKernel
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the desktop version, run &lt;code&gt;dotnet run -c Release&lt;/code&gt; in &lt;code&gt;GpuKernel.Desktop&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>blazor</category>
      <category>gpu</category>
    </item>
    <item>
      <title>Save large files in the browser without loading them into .NET</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Wed, 25 Nov 2026 16:26:40 +0000</pubDate>
      <link>https://dev.to/lostbeard/save-large-files-in-the-browser-without-loading-them-into-net-52nf</link>
      <guid>https://dev.to/lostbeard/save-large-files-in-the-browser-without-loading-them-into-net-52nf</guid>
      <description>&lt;p&gt;&lt;a href="https://lostbeard.github.io/SpawnDev.Examples/LargeFiles/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; | &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/tree/main/LargeFiles" rel="noopener noreferrer"&gt;Full example on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your Blazor app lets people save a file for offline use. It works with a 2 MB photo. Then someone picks a 200 MB video, and your app has to find 200 MB of .NET memory to hold it.&lt;/p&gt;

&lt;p&gt;Most of the time the app does not need those bytes in .NET at all. It only wants them moved from one place to another. The browser can do that itself.&lt;/p&gt;

&lt;p&gt;This article saves the same file two ways and compares the .NET memory each one takes. You need the .NET 10 SDK and a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the file goes
&lt;/h2&gt;

&lt;p&gt;The origin private file system (OPFS) is file storage that belongs to your site. It needs no permission prompt, and other sites cannot read it. It does not show up as a normal folder on the user's disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new blazorwasm -o LargeFiles --empty
&lt;span class="nb"&gt;cd&lt;/span&gt; LargeFiles
dotnet add package SpawnDev.SpawnJS
dotnet add package SpawnDev.SpawnJS.Blazor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;Program.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;LargeFiles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AspNetCore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Components&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebAssembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hosting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WebAssemblyHostBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootComponents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddSpawnJSRuntime&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&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="nc"&gt;SpawnJSRunAsync&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;Add these lines to &lt;code&gt;_Imports.razor&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@using SpawnDev.SpawnJS
@using SpawnDev.SpawnJS.JSObjects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Through .NET
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The usual way: the whole file becomes a byte[] in .NET.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;SaveThroughDotNet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;FileSystemWritableFileStream&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;buffer&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;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ArrayBuffer&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="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetTotalMemory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Close&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="n"&gt;used&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ReadBytes()&lt;/code&gt; copies the whole file into a .NET array. &lt;code&gt;Write&lt;/code&gt; then hands it back to the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Streamed
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The browser moves the bytes. .NET only says where from and where to.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;SaveStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;FileSystemWritableFileStream&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Stream&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;await&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PipeTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// also closes the target&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetTotalMemory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&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;&lt;code&gt;PipeTo&lt;/code&gt; connects the file's stream to the storage file's stream. The bytes go from one to the other inside the browser, and your C# code waits for it to finish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open the storage file
&lt;/h2&gt;

&lt;p&gt;Both versions write to the same place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Func&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;FileSystemWritableFileStream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;save&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;busy&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="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Saving..."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// let the page draw&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GetChosenFile&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="nc"&gt;MakeTestFile&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;folder&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;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDirectory&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;handle&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;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFileHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create&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="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;target&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateWritable&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="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetTotalMemory&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="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;saved&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFile&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="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Saved {saved.Size / 1048576.0:F1} MB. .NET memory grew by {Math.Max(0, after - before) / 1048576.0:F1} MB."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RemoveEntry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileName&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;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Could not save: {ex.Message}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collect&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="n"&gt;busy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The folder and file handles are wrappers around live browser objects, so each one gets a &lt;code&gt;using&lt;/code&gt;.&lt;/p&gt;

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

&lt;p&gt;For a 200 MB file:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Way&lt;/th&gt;
&lt;th&gt;.NET memory grew by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Through .NET&lt;/td&gt;
&lt;td&gt;200 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Streamed&lt;/td&gt;
&lt;td&gt;0.0 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The browser still uses memory of its own while it copies. The difference is that your .NET heap does not grow with the size of the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Play a video without loading it
&lt;/h2&gt;

&lt;p&gt;Back to that 200 MB video. To play it, your app still does not need the bytes. A video player needs a URL, and &lt;code&gt;URL.CreateObjectURL&lt;/code&gt; makes one for any &lt;code&gt;Blob&lt;/code&gt;: a file the user picked, a file from storage, or one you downloaded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;PlayFromStorage&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="n"&gt;busy&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="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Saving..."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;StopVideo&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;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GetChosenFile&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="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;GetSampleVideo&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;folder&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;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDirectory&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;handle&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;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFileHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;VideoName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create&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="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;target&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateWritable&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="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetTotalMemory&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="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Stream&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;await&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PipeTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;saved&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;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFile&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="n"&gt;videoUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;saved&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Playing {saved.Size / 1048576.0:F1} MB from storage. .NET memory grew by {Math.Max(0, GC.GetTotalMemory(false) - before) / 1048576.0:F1} MB."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Could not play: {ex.Message}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;busy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even the sample clip is never a .NET array. The response from &lt;code&gt;fetch&lt;/code&gt; becomes a &lt;code&gt;Blob&lt;/code&gt;, and only a reference to it reaches C#:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Even the download stays in the browser: the response becomes a Blob, not a byte[].&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;GetSampleVideo&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"BigBuckBunny-30.mp4"&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="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no sample video found, choose a file instead"&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="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run this yourself, put a video in &lt;code&gt;wwwroot&lt;/code&gt; as &lt;code&gt;BigBuckBunny-30.mp4&lt;/code&gt;, for example &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/blob/main/LargeFiles/wwwroot/BigBuckBunny-30.mp4" rel="noopener noreferrer"&gt;the clip from the example repo&lt;/a&gt;, or choose your own file on the page.&lt;/p&gt;

&lt;p&gt;The page hands that URL to an ordinary video element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;video src="@videoUrl" controls&amp;gt;&amp;lt;/video&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The player reads the file from storage as it needs it, and none of the video enters .NET. Revoke the URL when you are done with it, so the browser can let go of the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// An object URL keeps its file in use until it is revoked.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;StopVideo&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;videoUrl&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;null&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="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RevokeObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;videoUrl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;videoUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;folder&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;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDirectory&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;await&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RemoveEntry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;VideoName&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;
  
  
  Bring data into .NET only when .NET needs it
&lt;/h2&gt;

&lt;p&gt;The wrappers work with both kinds of data. &lt;code&gt;Write&lt;/code&gt; on the storage file takes .NET data, such as a &lt;code&gt;byte[]&lt;/code&gt; or a &lt;code&gt;string&lt;/code&gt;, and browser data, such as a &lt;code&gt;Blob&lt;/code&gt;, an &lt;code&gt;ArrayBuffer&lt;/code&gt; or a typed array. If your C# code made the data or has to work on it, pass the .NET type. If you are only moving it, pass the browser object and leave the bytes where they are.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you do need the bytes
&lt;/h2&gt;

&lt;p&gt;If your code has to look at the contents, read it in pieces. &lt;code&gt;Blob.Slice(start, end)&lt;/code&gt; gives you part of a file, so you only hold one piece at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole page
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;Pages/Home.razor&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@page "/"
@inject SpawnJSRuntime JS
@implements IAsyncDisposable

&amp;lt;main&amp;gt;
    &amp;lt;h1&amp;gt;Where does the file go?&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;Both buttons save the same file to this browser's private storage, then delete it. Compare how much .NET memory each one takes.&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label&amp;gt;Your own file, or leave empty for a @SizeMB MB test file: &amp;lt;input id="pick" type="file" /&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;button id="copy" disabled="@busy" @onclick="() =&amp;gt; Run(SaveThroughDotNet)"&amp;gt;Save through .NET&amp;lt;/button&amp;gt;
    &amp;lt;button id="stream" disabled="@busy" @onclick="() =&amp;gt; Run(SaveStream)"&amp;gt;Stream it&amp;lt;/button&amp;gt;
    &amp;lt;p id="result" role="status"&amp;gt;@result&amp;lt;/p&amp;gt;
    &amp;lt;h2&amp;gt;Play a video from storage&amp;lt;/h2&amp;gt;
    &amp;lt;p&amp;gt;Saves a video to storage and plays it from there. Leave the file above empty to use a 30 second Big Buck Bunny clip.&amp;lt;/p&amp;gt;
    &amp;lt;button id="play" disabled="@busy" @onclick="PlayFromStorage"&amp;gt;Play it&amp;lt;/button&amp;gt;
    @if (videoUrl is not null)
    {
        &amp;lt;p&amp;gt;&amp;lt;video id="video" src="@videoUrl" controls autoplay muted&amp;gt;&amp;lt;/video&amp;gt;&amp;lt;/p&amp;gt;
    }
    &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Big Buck Bunny (c) 2008 Blender Foundation, &amp;lt;a href="https://peach.blender.org"&amp;gt;peach.blender.org&amp;lt;/a&amp;gt;. Sunflower version by Janus Bager Kristensen, 2013. &amp;lt;a href="https://creativecommons.org/licenses/by/3.0/"&amp;gt;CC BY 3.0&amp;lt;/a&amp;gt;.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/main&amp;gt;

@code {
    const int SizeMB = 200;
    const string FileName = "test.bin";
    const string VideoName = "video";
    string? videoUrl;
    bool busy;
    string result = "";

    // The usual way: the whole file becomes a byte[] in .NET.
    async Task&amp;lt;long&amp;gt; SaveThroughDotNet(Blob file, FileSystemWritableFileStream target)
    {
        using var buffer = await file.ArrayBuffer();
        byte[] bytes = buffer.ReadBytes();
        var used = GC.GetTotalMemory(false);
        await target.Write(bytes);
        await target.Close();
        return used;
    }

    // The browser moves the bytes. .NET only says where from and where to.
    async Task&amp;lt;long&amp;gt; SaveStream(Blob file, FileSystemWritableFileStream target)
    {
        using var stream = file.Stream();
        await stream.PipeTo(target); // also closes the target
        return GC.GetTotalMemory(false);
    }

    async Task Run(Func&amp;lt;Blob, FileSystemWritableFileStream, Task&amp;lt;long&amp;gt;&amp;gt; save)
    {
        busy = true;
        result = "Saving...";
        await Task.Delay(50); // let the page draw
        try
        {
            using var file = GetChosenFile() ?? MakeTestFile();
            using var navigator = new Navigator();
            using var storage = navigator.Storage;
            using var folder = await storage.GetDirectory();
            using var handle = await folder.GetFileHandle(FileName, create: true);
            using var target = await handle.CreateWritable();

            GC.Collect();
            var before = GC.GetTotalMemory(true);
            var after = await save(file, target);

            using var saved = await handle.GetFile();
            result = $"Saved {saved.Size / 1048576.0:F1} MB. .NET memory grew by {Math.Max(0, after - before) / 1048576.0:F1} MB.";
            await folder.RemoveEntry(FileName);
        }
        catch (Exception ex)
        {
            result = $"Could not save: {ex.Message}";
        }
        GC.Collect();
        busy = false;
    }

    async Task PlayFromStorage()
    {
        busy = true;
        result = "Saving...";
        await StopVideo();
        try
        {
            using var file = GetChosenFile() ?? await GetSampleVideo();
            using var navigator = new Navigator();
            using var storage = navigator.Storage;
            using var folder = await storage.GetDirectory();
            using var handle = await folder.GetFileHandle(VideoName, create: true);
            using var target = await handle.CreateWritable();

            GC.Collect();
            var before = GC.GetTotalMemory(true);
            using var stream = file.Stream();
            await stream.PipeTo(target);

            using var saved = await handle.GetFile();
            videoUrl = URL.CreateObjectURL(saved);
            result = $"Playing {saved.Size / 1048576.0:F1} MB from storage. .NET memory grew by {Math.Max(0, GC.GetTotalMemory(false) - before) / 1048576.0:F1} MB.";
        }
        catch (Exception ex)
        {
            result = $"Could not play: {ex.Message}";
        }
        busy = false;
    }

    // Even the download stays in the browser: the response becomes a Blob, not a byte[].
    async Task&amp;lt;Blob&amp;gt; GetSampleVideo()
    {
        using var response = await JS.Fetch("BigBuckBunny-30.mp4");
        if (!response.Ok) throw new Exception("no sample video found, choose a file instead");
        return await response.Blob();
    }

    // An object URL keeps its file in use until it is revoked.
    async Task StopVideo()
    {
        if (videoUrl is null) return;
        URL.RevokeObjectURL(videoUrl);
        videoUrl = null;
        using var navigator = new Navigator();
        using var storage = navigator.Storage;
        using var folder = await storage.GetDirectory();
        await folder.RemoveEntry(VideoName);
    }

    public async ValueTask DisposeAsync() =&amp;gt; await StopVideo();

    Blob? GetChosenFile()
    {
        using var document = JS.GetDocument()!;
        using var input = document.GetElementById&amp;lt;HTMLInputElement&amp;gt;("pick")!;
        using var files = input.Files;
        return files?.FirstOrDefault();
    }

    // One MB of data, repeated. The browser holds it; nothing large is made in .NET.
    static Blob MakeTestFile()
    {
        using var block = new Blob(new[] { new byte[1048576] });
        return new Blob(Enumerable.Repeat(block, SizeMB));
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;dotnet run&lt;/code&gt; in your project, or clone the finished one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/LostBeard/SpawnDev.Examples
&lt;span class="nb"&gt;cd&lt;/span&gt; SpawnDev.Examples/LargeFiles
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>blazor</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Stop freezing your Blazor UI: run slow C# in a Web Worker</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Tue, 24 Nov 2026 20:46:41 +0000</pubDate>
      <link>https://dev.to/lostbeard/stop-freezing-your-blazor-ui-run-slow-c-in-a-web-worker-1no4</link>
      <guid>https://dev.to/lostbeard/stop-freezing-your-blazor-ui-run-slow-c-in-a-web-worker-1no4</guid>
      <description>&lt;p&gt;&lt;a href="https://lostbeard.github.io/SpawnDev.Examples/WebWorkers/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; | &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/tree/main/WebWorkers" rel="noopener noreferrer"&gt;Full example on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You add a button that does some real work. Someone clicks it, and the whole page stops. Nothing scrolls and no other button responds until the work is done.&lt;/p&gt;

&lt;p&gt;A Blazor WebAssembly app normally runs its C# on the same thread the browser uses to draw the page. While your loop runs, the browser cannot draw.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Task.Run&lt;/code&gt; does not help here. Without WebAssembly threading, it queues the work on that same thread.&lt;/p&gt;

&lt;p&gt;The browser's answer is a Web Worker: a separate thread with its own memory. In this article we move a slow C# method into one and measure what changes. You need the .NET 10 SDK and a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Something slow
&lt;/h2&gt;

&lt;p&gt;This counts prime numbers the hard way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nc"&gt;WebWorkers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Primes&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Counts the primes up to and including &amp;lt;paramref name="limit"/&amp;gt;. Slow on purpose.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&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;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;var&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&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="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;isPrime&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;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;d&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="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;isPrime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;count&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="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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new blazorwasm -o WebWorkers --empty
&lt;span class="nb"&gt;cd&lt;/span&gt; WebWorkers
dotnet add package SpawnDev.SpawnJS
dotnet add package SpawnDev.SpawnJS.Blazor
dotnet add package SpawnDev.SpawnJS.WebWorkers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the class above as &lt;code&gt;Primes.cs&lt;/code&gt;, then replace &lt;code&gt;Program.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AspNetCore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Components&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebAssembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hosting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebWorkers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;WebWorkers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WebAssemblyHostBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddSpawnJSRuntime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddWebWorkerService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// A worker runs this file too, but it has no page to render into.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IsWindow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootComponents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#app"&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&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="nc"&gt;SpawnJSRunAsync&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;A worker starts a second copy of your app, so it runs &lt;code&gt;Program.cs&lt;/code&gt; too. It has no page to draw on, which is why the root component is added only when &lt;code&gt;JS.IsWindow&lt;/code&gt; is true.&lt;/p&gt;

&lt;p&gt;Add these lines to &lt;code&gt;_Imports.razor&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@using SpawnDev.SpawnJS
@using SpawnDev.SpawnJS.WebWorkers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run it on the page
&lt;/h2&gt;

&lt;p&gt;The page shows a clock with milliseconds. The clock runs on the same thread as the rest of the page, so when the page freezes, the clock stops:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The clock runs on the page's thread, so it stops whenever that thread is busy.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;RunClock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sinceUpdate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Stopwatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StartNew&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;while&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="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;clock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HH:mm:ss.fff"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nc"&gt;StateHasChanged&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;await&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&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;sinceUpdate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Elapsed&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;longestStop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;longestStop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sinceUpdate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Elapsed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;sinceUpdate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first button calls the method directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;CountHere&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;await&lt;/span&gt; &lt;span class="nc"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Primes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Finish&lt;/span&gt;&lt;span class="p"&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Start&lt;/code&gt; and &lt;code&gt;Finish&lt;/code&gt; update the message and measure how long the clock stopped. Click the button and watch: the clock stops dead until the answer appears.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it in a worker
&lt;/h2&gt;

&lt;p&gt;The second button changes one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;CountInWorker&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;await&lt;/span&gt; &lt;span class="nc"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Workers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TaskPool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Run&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Primes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Limit&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;await&lt;/span&gt; &lt;span class="nc"&gt;Finish&lt;/span&gt;&lt;span class="p"&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Workers&lt;/code&gt; is the injected &lt;code&gt;WebWorkerService&lt;/code&gt;. &lt;code&gt;TaskPool.Run&lt;/code&gt; takes the call you want to make, sends the method and its arguments to a worker, and gives you the result as a &lt;code&gt;Task&lt;/code&gt;. Click it and the clock keeps running.&lt;/p&gt;

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

&lt;p&gt;The page reports how long the clock stopped while it counted the primes up to six million:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Button&lt;/th&gt;
&lt;th&gt;Clock stopped for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Count on the page&lt;/td&gt;
&lt;td&gt;about 3 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Count in a worker&lt;/td&gt;
&lt;td&gt;about 0.05 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The clock waits 30 ms between updates, so 0.05 seconds is close to its normal pace. These are from one desktop PC in headless Chromium. Your times will differ, and slower devices freeze for longer.&lt;/p&gt;

&lt;p&gt;The worker does not make the counting itself faster. It moves the work to where it does not block the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to know first
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The first call is slower.&lt;/strong&gt; A worker has to start its own copy of your app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workers do not share your variables.&lt;/strong&gt; Each has its own memory, so a static field you set on the page is not set in the worker. Pass what the method needs as arguments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arguments and results are sent between threads.&lt;/strong&gt; Small values are cheap. For large arrays, see transferable objects in the &lt;a href="https://github.com/LostBeard/SpawnDev.SpawnJS.WebWorkers#transferable-objects" rel="noopener noreferrer"&gt;WebWorkers README&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No special server headers are needed&lt;/strong&gt; for this example.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The whole page
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;Pages/Home.razor&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@page "/"
@using System.Diagnostics
@inject WebWorkerService Workers

&amp;lt;main&amp;gt;
    &amp;lt;h1&amp;gt;Does the clock stop?&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;Each button counts the primes up to @Limit.ToString("N0"). It is the same C# method, run in two different places. Watch the clock while it works.&amp;lt;/p&amp;gt;
    &amp;lt;p id="clock"&amp;gt;@clock&amp;lt;/p&amp;gt;
    &amp;lt;button id="here" disabled="@busy" @onclick="CountHere"&amp;gt;Count on the page&amp;lt;/button&amp;gt;
    &amp;lt;button id="worker" disabled="@busy" @onclick="CountInWorker"&amp;gt;Count in a worker&amp;lt;/button&amp;gt;
    &amp;lt;p id="result" role="status"&amp;gt;@result&amp;lt;/p&amp;gt;
&amp;lt;/main&amp;gt;

@code {
    const int Limit = 6_000_000;
    string clock = "";
    string result = "";
    bool busy;
    TimeSpan longestStop;

    protected override void OnInitialized() =&amp;gt; _ = RunClock();

    // The clock runs on the page's thread, so it stops whenever that thread is busy.
    async Task RunClock()
    {
        var sinceUpdate = Stopwatch.StartNew();
        while (true)
        {
            clock = DateTime.Now.ToString("HH:mm:ss.fff");
            StateHasChanged();
            await Task.Delay(30);
            if (sinceUpdate.Elapsed &amp;gt; longestStop) longestStop = sinceUpdate.Elapsed;
            sinceUpdate.Restart();
        }
    }

    async Task CountHere()
    {
        await Start();
        var count = Primes.Count(Limit);
        await Finish(count);
    }

    async Task CountInWorker()
    {
        await Start();
        var count = await Workers.TaskPool.Run(() =&amp;gt; Primes.Count(Limit));
        await Finish(count);
    }

    async Task Start()
    {
        busy = true;
        result = "Counting...";
        await Task.Delay(100); // let the page draw before the work starts
        longestStop = TimeSpan.Zero;
    }

    async Task Finish(int count)
    {
        await Task.Delay(100); // let the clock notice a stop that has just ended
        result = $"Found {count:N0} primes. The clock's longest stop was {longestStop.TotalSeconds:F2} seconds.";
        busy = false;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;dotnet run&lt;/code&gt; in your project, or clone the finished one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/LostBeard/SpawnDev.Examples
&lt;span class="nb"&gt;cd&lt;/span&gt; SpawnDev.Examples/WebWorkers
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>blazor</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Call browser APIs from Blazor without writing JavaScript</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Tue, 24 Nov 2026 19:47:00 +0000</pubDate>
      <link>https://dev.to/lostbeard/call-browser-apis-from-blazor-without-writing-javascript-m4o</link>
      <guid>https://dev.to/lostbeard/call-browser-apis-from-blazor-without-writing-javascript-m4o</guid>
      <description>&lt;p&gt;&lt;a href="https://lostbeard.github.io/SpawnDev.Examples/BrowserApis/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; | &lt;a href="https://github.com/LostBeard/SpawnDev.Examples/tree/main/BrowserApis" rel="noopener noreferrer"&gt;Full example on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are following a recipe on your phone. Your hands are covered in flour, and the screen goes dark.&lt;/p&gt;

&lt;p&gt;Browsers have a fix for this, the Screen Wake Lock API. Blazor has no built-in wrapper for it, so the usual route is a JavaScript module, an &lt;code&gt;IJSRuntime&lt;/code&gt; import, and a string name for every function you call. A typo in one of those strings shows up at run time.&lt;/p&gt;

&lt;p&gt;This article does it in C# instead. We will build a small recipe page that keeps the screen on, takes the lock back when you return to the tab, and copies the ingredients to the clipboard. You need the .NET 10 SDK and a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The usual way
&lt;/h2&gt;

&lt;p&gt;With plain Blazor interop you write a JavaScript file first:&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;let&lt;/span&gt; &lt;span class="n"&gt;sentinel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;lock&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="n"&gt;sentinel&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;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wakeLock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"screen"&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;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;unlock&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;await&lt;/span&gt; &lt;span class="n"&gt;sentinel&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you import it and call it by name. That is fine for one function. It gets harder when JavaScript needs to call you back, because you then also manage a &lt;code&gt;DotNetObjectReference&lt;/code&gt; and its lifetime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up SpawnJS
&lt;/h2&gt;

&lt;p&gt;SpawnDev.SpawnJS wraps browser APIs as C# classes. Create a Blazor WebAssembly app and add two packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new blazorwasm -o BrowserApis --empty
&lt;span class="nb"&gt;cd&lt;/span&gt; BrowserApis
dotnet add package SpawnDev.SpawnJS
dotnet add package SpawnDev.SpawnJS.Blazor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;Program.cs&lt;/code&gt;, add &lt;code&gt;AddSpawnJSRuntime()&lt;/code&gt; and start the app with &lt;code&gt;SpawnJSRunAsync()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;BrowserApis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AspNetCore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Components&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebAssembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hosting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;SpawnDev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SpawnJS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WebAssemblyHostBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootComponents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddSpawnJSRuntime&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;await&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&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="nc"&gt;SpawnJSRunAsync&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;Add these lines to &lt;code&gt;_Imports.razor&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@using SpawnDev.SpawnJS
@using SpawnDev.SpawnJS.JSObjects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The template comes with a page at &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;Pages/Home.razor&lt;/code&gt;. Delete it and add your own, &lt;code&gt;Pages/CookMode.razor&lt;/code&gt;. The next sections explain its main parts, and the whole file is at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the screen on
&lt;/h2&gt;

&lt;p&gt;In JavaScript the call is &lt;code&gt;navigator.wakeLock.request()&lt;/code&gt;. In C# it has the same shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;KeepScreenOn&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;screenLock&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&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="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;wakeLock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WakeLock&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;wakeLock&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;cookMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"This browser cannot keep the screen on."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;granted&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;wakeLock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&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="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;cookMode&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;screenLock&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// Stopped, or already locked, while the request was in flight.&lt;/span&gt;
            &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;granted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Release&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="n"&gt;granted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Dispose&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="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;screenLock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;granted&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;screenLock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OnRelease&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nc"&gt;ScreenLock_OnRelease&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&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;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// The browser can refuse, for example on low battery.&lt;/span&gt;
        &lt;span class="n"&gt;cookMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"The browser refused: {ex.Message}"&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;Three things to notice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feature detection is a null check.&lt;/strong&gt; &lt;code&gt;navigator.WakeLock&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt; when the browser does not have the API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Promises are Tasks.&lt;/strong&gt; You &lt;code&gt;await&lt;/code&gt; them, and a rejected promise is an exception you can catch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;using&lt;/code&gt; matters.&lt;/strong&gt; Each wrapper holds a reference to a live JavaScript object. Disposing the wrapper lets go of it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Listen to browser events
&lt;/h2&gt;

&lt;p&gt;Browsers release the lock when the tab is hidden, so switching apps to answer a message turns the feature off. To take it back, listen for the page becoming visible again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;OnInitialized&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="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetDocument&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="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OnVisibilityChange&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nc"&gt;Document_OnVisibilityChange&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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Take the lock back when the visitor returns to the tab.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Document_OnVisibilityChange&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;document&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Hidden&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;cookMode&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="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;KeepScreenOn&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="nc"&gt;StateHasChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Subscribing is &lt;code&gt;+=&lt;/code&gt; and unsubscribing is &lt;code&gt;-=&lt;/code&gt;, like any C# event. &lt;strong&gt;Match every &lt;code&gt;+=&lt;/code&gt; with a &lt;code&gt;-=&lt;/code&gt; before you dispose the object.&lt;/strong&gt; Otherwise the browser can call into a component that no longer exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy to the clipboard
&lt;/h2&gt;

&lt;p&gt;The same pattern works for other APIs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;CopyIngredients&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Navigator&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;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;clipboard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Clipboard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;clipboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WriteText&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="nc"&gt;Join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ingredients&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="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Copied."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; $&lt;span class="s2"&gt;"Could not copy: {ex.Message}"&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;Clipboard access needs a secure context, so it works on &lt;code&gt;https://&lt;/code&gt; and &lt;code&gt;localhost&lt;/code&gt;, and browsers may require that the call comes from a click.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clean up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nc"&gt;ValueTask&lt;/span&gt; &lt;span class="nc"&gt;DisposeAsync&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="n"&gt;cookMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OnVisibilityChange&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="nc"&gt;Document_OnVisibilityChange&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Dispose&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="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;LetScreenSleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When there is no wrapper
&lt;/h2&gt;

&lt;p&gt;You can call anything by name, including a function from a third-party script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// JavaScript: btoa("Hello")&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;JS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Call&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&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;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"btoa"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&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;Argument types come first and the return type comes last. &lt;code&gt;Get&lt;/code&gt; reads a property, and &lt;code&gt;Call&lt;/code&gt; runs a method.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole page
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@page "/"
@inject SpawnJSRuntime JS
@implements IAsyncDisposable

&amp;lt;main&amp;gt;
    &amp;lt;h1&amp;gt;Pancakes&amp;lt;/h1&amp;gt;
    &amp;lt;ul&amp;gt;
        @foreach (var item in ingredients)
        {
            &amp;lt;li&amp;gt;@item&amp;lt;/li&amp;gt;
        }
    &amp;lt;/ul&amp;gt;
    &amp;lt;button id="cook" @onclick="ToggleCookMode"&amp;gt;@(cookMode ? "Stop cook mode" : "Start cook mode")&amp;lt;/button&amp;gt;
    &amp;lt;button id="copy" @onclick="CopyIngredients"&amp;gt;Copy ingredients&amp;lt;/button&amp;gt;
    &amp;lt;p id="screen"&amp;gt;Screen: @(screenLock is null ? "may sleep" : "staying on")&amp;lt;/p&amp;gt;
    &amp;lt;p id="status" role="status"&amp;gt;@status&amp;lt;/p&amp;gt;
&amp;lt;/main&amp;gt;

@code {
    readonly string[] ingredients = ["2 cups flour", "2 eggs", "1 1/2 cups milk", "1 tbsp sugar"];
    Document? document;
    WakeLockSentinel? screenLock;
    bool cookMode;
    string status = "";

    protected override void OnInitialized()
    {
        document = JS.GetDocument();
        document!.OnVisibilityChange += Document_OnVisibilityChange;
    }

    async Task ToggleCookMode()
    {
        cookMode = !cookMode;
        if (cookMode) await KeepScreenOn();
        else await LetScreenSleep();
    }

    async Task KeepScreenOn()
    {
        if (screenLock is not null) return;
        using var navigator = new Navigator();
        using var wakeLock = navigator.WakeLock;
        if (wakeLock is null)
        {
            cookMode = false;
            status = "This browser cannot keep the screen on.";
            return;
        }
        try
        {
            var granted = await wakeLock.Request();
            if (!cookMode || screenLock is not null)
            {
                // Stopped, or already locked, while the request was in flight.
                await granted.Release();
                granted.Dispose();
                return;
            }
            screenLock = granted;
            screenLock.OnRelease += ScreenLock_OnRelease;
            status = "";
        }
        catch (Exception ex)
        {
            // The browser can refuse, for example on low battery.
            cookMode = false;
            status = $"The browser refused: {ex.Message}";
        }
    }

    async Task LetScreenSleep()
    {
        var released = DetachLock();
        if (released is null) return;
        await released.Release();
        released.Dispose();
    }

    // The browser releases the lock itself when the tab is hidden.
    void ScreenLock_OnRelease()
    {
        DetachLock()?.Dispose();
        StateHasChanged();
    }

    // Take the lock back when the visitor returns to the tab.
    async void Document_OnVisibilityChange()
    {
        if (document is null || document.Hidden || !cookMode) return;
        await KeepScreenOn();
        StateHasChanged();
    }

    async Task CopyIngredients()
    {
        using var navigator = new Navigator();
        using var clipboard = navigator.Clipboard;
        try
        {
            await clipboard.WriteText(string.Join("\n", ingredients));
            status = "Copied.";
        }
        catch (Exception ex)
        {
            status = $"Could not copy: {ex.Message}";
        }
    }

    WakeLockSentinel? DetachLock()
    {
        var current = screenLock;
        screenLock = null;
        if (current is not null) current.OnRelease -= ScreenLock_OnRelease;
        return current;
    }

    public async ValueTask DisposeAsync()
    {
        cookMode = false;
        if (document is not null)
        {
            document.OnVisibilityChange -= Document_OnVisibilityChange;
            document.Dispose();
            document = null;
        }
        await LetScreenSleep();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;dotnet run&lt;/code&gt; in your project, or clone the finished one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/LostBeard/SpawnDev.Examples
&lt;span class="nb"&gt;cd&lt;/span&gt; SpawnDev.Examples/BrowserApis
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Already using SpawnDev.BlazorJS? It offers the same style of typed wrappers and stays supported. SpawnJS is the newer library, and it also runs outside Blazor. Both are MIT licensed, with all work done in public, so you can use them and fork them.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>blazor</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Text to 3D, 100% in the browser: TRELLIS.2 on WebGPU from C#</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Sat, 17 Oct 2026 23:22:13 +0000</pubDate>
      <link>https://dev.to/lostbeard/text-to-3d-100-in-the-browser-trellis2-on-webgpu-from-c-21d3</link>
      <guid>https://dev.to/lostbeard/text-to-3d-100-in-the-browser-trellis2-on-webgpu-from-c-21d3</guid>
      <description>&lt;p&gt;Type "a wooden treasure chest with iron bands", wait about three minutes, and download a textured 3D model. Nothing leaves your machine. The whole pipeline runs on your GPU, in a browser tab, over WebGPU.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://lostbeard.github.io/SpawnDev.ILGPU.ML/text-to-3d" rel="noopener noreferrer"&gt;lostbeard.github.io/SpawnDev.ILGPU.ML/text-to-3d&lt;/a&gt; (desktop GPU recommended; the ~10 GB weight download is opt-in and cached)&lt;/p&gt;

&lt;p&gt;To our knowledge this is the first fully client-side &lt;a href="https://github.com/microsoft/TRELLIS.2" rel="noopener noreferrer"&gt;TRELLIS.2&lt;/a&gt; on the web. It ships with &lt;a href="https://www.nuget.org/packages/SpawnDev.ILGPU.ML/5.3.12" rel="noopener noreferrer"&gt;SpawnDev.ILGPU.ML 5.3.12&lt;/a&gt;, a .NET library that runs neural networks on GPU kernels written in C#.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SD Turbo&lt;/strong&gt; draws the object from your prompt (or skip it and drop in a photo)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RMBG-1.4&lt;/strong&gt; cuts the object out&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TRELLIS.2-4B&lt;/strong&gt; (Microsoft, MIT) builds it: DINOv3 image features, then three 1.3B-parameter flow transformers for sparse structure, shape and texture, then sparse VAE decoders and a dual-grid mesh&lt;/li&gt;
&lt;li&gt;Mesh clustering and simplification, UV atlas, texture bake&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;PBR GLB&lt;/strong&gt; (base colour + metallic-roughness) you can drop into Blender, Unity or three.js&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Measured on an RTX 4070 in Chrome, weights cached:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Photo -&amp;gt; GLB, fresh page&lt;/td&gt;
&lt;td&gt;148 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Photo -&amp;gt; GLB, next generation&lt;/td&gt;
&lt;td&gt;134 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt -&amp;gt; GLB&lt;/td&gt;
&lt;td&gt;180 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first working version took 712 s that same morning. Here's where the time went.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. GPU kernels in C#, not hand-written WGSL
&lt;/h2&gt;

&lt;p&gt;Every kernel is a C# method that &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt; compiles to WGSL (and to CUDA, OpenCL or CPU code on the desktop, from the same source). The two kernels that matter for a transformer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A register-tiled GEMM&lt;/strong&gt;: 128x128 output tiles, 256 threads, an 8x8 block of accumulators per thread. A single kernel covers bf16 and f16 weights and gathered rows, with a separate branch-free inner loop for each.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flash attention&lt;/strong&gt;: 8 lanes share each query, 4 queries per thread, with subgroup shuffles for the reductions. Devices without subgroups use a shared-memory variant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running the diffusion sampler with these kernels lands at roughly 8 TFLOPS on GEMM and 5.6 TFLOPS on attention in WebGPU on a 4070.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. 10 GB of weights vs. a browser quota
&lt;/h2&gt;

&lt;p&gt;Browsers give each site a storage quota, and it's often smaller than the model. &lt;code&gt;RangeStreamModelSource.PlanCacheAsync&lt;/code&gt; picks the subset of checkpoint files that fills the quota best and caches those in OPFS. Everything else streams on each run with HTTP range requests, four 16 MB requests in flight, straight from the fetch into GPU buffers without passing through the .NET heap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ranged&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RangeStreamModelSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hubModelSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ranged&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PlanCacheAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Trellis2Weights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HubWeightFiles&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="n"&gt;freeQuotaBytes&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;300_000_000L&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;gen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Trellis2ImageTo3D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Trellis2Weights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromModelSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ranged&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="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;glb&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;gen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GenerateGlbAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rgbaPixels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&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;
  
  
  3. Shader compiles were serial
&lt;/h2&gt;

&lt;p&gt;WebGPU compiles a pipeline at its first use, one at a time. The big GEMM and attention kernels each took seconds to compile, and they all queued up at the start of the run. &lt;code&gt;WebGPUAccelerator.PrecompileAsync&lt;/code&gt; (new in SpawnDev.ILGPU 5.3.8) builds them with &lt;code&gt;createComputePipelineAsync&lt;/code&gt; in the background while the weights load. Four shaders: 1571 ms serially, 511 ms in parallel.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A 3-million-triangle mesh
&lt;/h2&gt;

&lt;p&gt;The dual-grid mesh comes out at about 3M triangles. Feeding all of that to the edge-collapse simplifier is slow in a browser, so &lt;code&gt;MeshClusterer&lt;/code&gt; first runs adaptive octree quadric clustering on the GPU, bringing it down to about 0.5M before the edge collapse produces the final 150K faces.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Blazor WebAssembly AOT
&lt;/h2&gt;

&lt;p&gt;The non-GPU stages (simplification, UV atlas packing) are plain C#. Under the .NET interpreter they're slow. AOT brought mesh simplification from 41.3 s to 2.6 s and the UV atlas from 16.8 s to 0.8 s. GitHub Pages refuses files over 100 MB, and the AOT &lt;code&gt;dotnet.native.wasm&lt;/code&gt; is bigger than that, so the deploy keeps only gzip copies and a small &lt;code&gt;loadBootResource&lt;/code&gt; hook inflates them with &lt;code&gt;DecompressionStream&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, read it, use it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Demo: &lt;a href="https://lostbeard.github.io/SpawnDev.ILGPU.ML/text-to-3d" rel="noopener noreferrer"&gt;/text-to-3d&lt;/a&gt; and &lt;a href="https://lostbeard.github.io/SpawnDev.ILGPU.ML/image-to-3d" rel="noopener noreferrer"&gt;/image-to-3d&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How it works, stage by stage: &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML/blob/master/Docs/trellis2.md" rel="noopener noreferrer"&gt;Docs/trellis2.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source (MIT): &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML" rel="noopener noreferrer"&gt;github.com/LostBeard/SpawnDev.ILGPU.ML&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NuGet: &lt;code&gt;dotnet add package SpawnDev.ILGPU.ML&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Model licences: TRELLIS.2 is MIT; DINOv3, SD Turbo and RMBG-1.4 carry their own licences. No weights ship in the package; the demo downloads them from Hugging Face on first use.&lt;/p&gt;

&lt;p&gt;If you run it, I'd love to hear your GPU and your timings in the comments.&lt;/p&gt;

</description>
      <category>webgpu</category>
      <category>dotnet</category>
      <category>csharp</category>
      <category>ai</category>
    </item>
    <item>
      <title>Update: Google reversed it. The Chrome Web Store rejected my free WebAssembly extension for not using permissions it uses.</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Sat, 10 Oct 2026 11:32:07 +0000</pubDate>
      <link>https://dev.to/lostbeard/the-chrome-web-store-is-hostile-to-webassembly-google-rejected-my-free-extension-for-not-using-177m</link>
      <guid>https://dev.to/lostbeard/the-chrome-web-store-is-hostile-to-webassembly-google-rejected-my-free-extension-for-not-using-177m</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update, October 14, 2026: Google reversed this.&lt;/strong&gt; At 8:30 AM Eastern the Chrome Web Store published Anaglyphohol 4.0.0, and at 8:40 Chrome Web Store Developer Support replied to my appeal:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We took a closer look at your item again and found it to be compliant with our policies.&lt;/p&gt;

&lt;p&gt;Your item has been reinstated and will be available in the store shortly. We apologize for the inconvenience caused to you in this matter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The listing now shows version 4.0.0. Thank you to whoever took the second look, and thank you for the apology. I wrote back to say so. Google accepted the same 4.0.0 build it had rejected twice. The night before, Microsoft Edge Add-ons had published the same 4.0.0 package without a rejection. Google's reply did not say what changed, so I can't tell you why it went differently this time. The rest of this article is the record of the week before the reversal, kept as it was written, with the parts that are no longer true corrected.&lt;/p&gt;


&lt;/blockquote&gt;

&lt;p&gt;In April I wrote about &lt;a href="https://dev.to/lostbeard/i-built-a-chrome-extension-in-blazor-wasm-rewrote-it-in-javascript-and-im-going-back-to-blazor-305g"&gt;building a Chrome extension in Blazor WebAssembly, rewriting it in JavaScript, and going back to Blazor&lt;/a&gt;. I went back. Anaglyphohol 4.0.0 is done and it is the best version I have ever shipped. For a week, Google would not let Chrome users have it.&lt;/p&gt;

&lt;p&gt;This is what happened, with every email, line of code and commit linked. The full record is on GitHub: &lt;strong&gt;&lt;a href="https://github.com/LostBeard/anaglyphohol-chrome-web-store" rel="noopener noreferrer"&gt;anaglyphohol-chrome-web-store&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Anaglyphohol is
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/LostBeard/AnaglyphoholV2" rel="noopener noreferrer"&gt;Anaglyphohol&lt;/a&gt; is a browser extension that turns the videos and images on web pages into 3D as you browse. Put on red/cyan glasses, open a video, and the picture gains depth. A depth estimation AI runs on your own graphics card through WebGPU. Nothing is uploaded, there is no account, no ads, no tracking. It is free on every site, and the source is public.&lt;/p&gt;

&lt;p&gt;Version 4.0.0 is written in C# (.NET 10, Blazor WebAssembly) and runs the depth models and 3D kernels on the GPU with my own open source libraries, &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt; and &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML" rel="noopener noreferrer"&gt;SpawnDev.ILGPU.ML&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rejection 1: "Keyword spam"
&lt;/h2&gt;

&lt;p&gt;On October 7 the Chrome Web Store rejected 4.0.0 for "excessive and / or irrelevant keywords" in the description. The offending text:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"YouTube, Twitch, Pluto TV, Tubi, Bing, Google, Yahoo and more."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Those are the sites the extension is built for. It turns 3D on by default on exactly those sites. Google called a list of supported sites, one of which is Google, "irrelevant". Version 2.0.0 had a list just like it in its description and passed review.&lt;/p&gt;

&lt;p&gt;I removed the list anyway and used the exact description Google had already approved for version 3.0.14. Resubmitted the same day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rejection 2: "Requesting but not using" storage and offscreen
&lt;/h2&gt;

&lt;p&gt;On October 9 it was rejected again. This time the claim was that Anaglyphohol requests the &lt;code&gt;storage&lt;/code&gt; and &lt;code&gt;offscreen&lt;/code&gt; permissions and does not use them.&lt;/p&gt;

&lt;p&gt;Both are used.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;storage&lt;/code&gt; saves every setting the user changes: 3D on or off, per-site switches, 3D mode, depth level, focus, toolbar state. Without it, no setting survives a page load.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;offscreen&lt;/code&gt; runs the "Shared 3D converter", an option that runs one depth and 3D converter for every tab instead of one per page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notice what this rejection is not. Google did not say Anaglyphohol is malware, a scam, or a privacy risk. It did not say the extension does anything harmful. It said the extension asks for two permissions and does not use them: in other words, that it does too little. Neither permission even shows users a warning at install time (&lt;a href="https://developer.chrome.com/docs/extensions/reference/permissions-list" rel="noopener noreferrer"&gt;Chrome's permission list&lt;/a&gt; gives &lt;code&gt;history&lt;/code&gt;, &lt;code&gt;tabs&lt;/code&gt; and others a "Warning displayed" line; &lt;code&gt;storage&lt;/code&gt; and &lt;code&gt;offscreen&lt;/code&gt; have none). And the claim is false: both are used. Google rejected a free extension for not using code that it does use. &lt;/p&gt;

&lt;p&gt;Here is why a scan that only reads JavaScript misses them. Anaglyphohol is C# compiled to WebAssembly. Chrome supports WebAssembly in Manifest V3 extensions; &lt;code&gt;wasm-unsafe-eval&lt;/code&gt; exists for exactly this. The compiled code reaches the extension APIs through an interop library, &lt;a href="https://github.com/LostBeard/SpawnDev.SpawnJS.BrowserExtension" rel="noopener noreferrer"&gt;SpawnDev.SpawnJS.BrowserExtension&lt;/a&gt;, which reads properties off the global &lt;code&gt;chrome&lt;/code&gt; object by name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Browser.cs&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;Storage&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;JSRef&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"storage"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Offscreen&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;Offscreen&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;JSRef&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Offscreen&lt;/span&gt;&lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"offscreen"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Offscreen/Offscreen.cs&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="nc"&gt;CreateDocument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OffscreenCreateParameters&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;JSRef&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CallVoidAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"createDocument"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;HasDocument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;JSRef&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CallAsync&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hasDocument"&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;So &lt;code&gt;chrome.storage&lt;/code&gt; and &lt;code&gt;chrome.offscreen&lt;/code&gt; never appear as literal text in the package's &lt;code&gt;.js&lt;/code&gt; files. If your review is a grep of the JavaScript, you will not find them. The strings are still in the package: &lt;code&gt;storage&lt;/code&gt;, &lt;code&gt;offscreen&lt;/code&gt;, &lt;code&gt;createDocument&lt;/code&gt; and &lt;code&gt;hasDocument&lt;/code&gt; sit in the compiled &lt;code&gt;.wasm&lt;/code&gt;, stored as UTF-16 the way .NET stores strings.&lt;/p&gt;

&lt;h2&gt;
  
  
  The appeal
&lt;/h2&gt;

&lt;p&gt;Google's appeal reply asked for "evidence(code snippet) of usage of above permission".&lt;/p&gt;

&lt;p&gt;So I sent it. Every call site, file names, line numbers, the interop code that calls &lt;code&gt;chrome.storage.sync.get/set&lt;/code&gt; and &lt;code&gt;chrome.offscreen.createDocument/hasDocument/closeDocument&lt;/code&gt;, GitHub permalinks to the exact commits in the build, and the steps to watch the offscreen document run in &lt;code&gt;chrome://extensions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The answer, the next morning:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We are not able to see the provided code in the extension package. So, we request you to update by removing "storage" and "offscreen" permissions from the manifest file.&lt;/p&gt;

&lt;p&gt;[...] Please reply to this email with evidence that the functionality is not working after removing the permissions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They asked for code. They got code. They said they cannot see the code. Then they asked me to break my own extension and send proof that it is broken.&lt;/p&gt;

&lt;p&gt;Checking whether a permission is used is the review. It takes about a minute: install the extension, change a setting, reload the page, see that it stuck. Handing that job back to the developer, and asking for a deliberately broken build as "evidence", was the wrong way to do it.&lt;/p&gt;

&lt;p&gt;That was the second denial, on October 10. The reversal came four days later (see the update at the top).&lt;/p&gt;

&lt;h2&gt;
  
  
  Google already approved this exact pattern. Twice.
&lt;/h2&gt;

&lt;p&gt;This is the part that makes it indefensible.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Built with&lt;/th&gt;
&lt;th&gt;Permissions&lt;/th&gt;
&lt;th&gt;Chrome Web Store&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.0.x&lt;/td&gt;
&lt;td&gt;.NET 8 Blazor WebAssembly&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;storage&lt;/code&gt;, used from WebAssembly&lt;/td&gt;
&lt;td&gt;Approved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.0.0&lt;/td&gt;
&lt;td&gt;.NET 8 Blazor WebAssembly&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;storage&lt;/code&gt;, used from WebAssembly&lt;/td&gt;
&lt;td&gt;Approved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.0.14&lt;/td&gt;
&lt;td&gt;JavaScript and HTML&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;storage&lt;/code&gt;, &lt;code&gt;offscreen&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Approved, live today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4.0.0&lt;/td&gt;
&lt;td&gt;.NET 10 Blazor WebAssembly&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;storage&lt;/code&gt;, &lt;code&gt;offscreen&lt;/code&gt;, used from WebAssembly&lt;/td&gt;
&lt;td&gt;Rejected twice as "not used", appeals denied twice, then reinstated October 14&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Versions 1 and 2 were Blazor WebAssembly apps that called &lt;code&gt;storage&lt;/code&gt; from compiled code, invisible to a text search, exactly like version 4. Google approved both. Version 3.0.14, still being served to Chrome users today, requests the exact same two permissions as 4.0.0 and has the exact same description. Google approved the extension it was serving and rejected the update that asked for nothing more, until it reversed itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the record showed
&lt;/h2&gt;

&lt;p&gt;Put it together. Chrome supports WebAssembly in extensions; &lt;code&gt;wasm-unsafe-eval&lt;/code&gt; exists for it. For a week, the review treated a permission as unused unless the package's JavaScript named it. When I sent the code, the answer was that they could not see it, and the fix they demanded was removing the permissions, not reading the code. Google's own AI describes the review as a string-matching scanner and advises faking the JavaScript (more on that below).&lt;/p&gt;

&lt;p&gt;That is why I titled this article "hostile to WebAssembly". An extension written in C#, Rust, Go, C++ or anything else that compiles to WebAssembly can use exactly the APIs it declares and still be rejected by a scan that only reads JavaScript. My versions 1 and 2 got through. Version 4 did not, and nothing in the rules told me which outcome to expect.&lt;/p&gt;

&lt;p&gt;Google has now looked again and approved the same build it rejected, which is the right result. What I can't tell you is whether the scan itself changed. If you ship WebAssembly to the Chrome Web Store and get this rejection, appeal with the code, and keep appealing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free work
&lt;/h2&gt;

&lt;p&gt;Extensions are a large part of what makes Chrome worth using, and developers build them for free. Anaglyphohol asks Google for nothing but a listing. The check that settles a claim like this takes about a minute: install the extension, change a setting, reload, see that it stuck. It took two denied appeals and a week to get that second look.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs to give something away on Google's store
&lt;/h2&gt;

&lt;p&gt;To put a free extension on the Chrome Web Store, I paid Google a registration fee, and Google required my full name, home address and phone number. As a "trader", all three were published on the listing page. The dashboard later switched me to "non-trader" without asking me to confirm. Switching back meant uploading my driver's license again, so I left it. My name and home street address are still on the public page.&lt;/p&gt;

&lt;p&gt;Then every update means a full release build (over an hour; it is AOT compiled), a submission, a wait, and a form letter. This one update cost days. The time should have gone into the extension and the open source libraries other developers use for free.&lt;/p&gt;

&lt;p&gt;And it is not only Chrome. Google now requires Android developers to register and verify their identity with Google before their apps can be installed on certified Android devices, even apps that never touch the Play Store. Enforcement began September 30, 2026 in Brazil, Indonesia, Singapore and Thailand, with a worldwide rollout planned for 2027. Independent developers are being treated as the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not the first time
&lt;/h2&gt;

&lt;p&gt;This is not my first write-up of Google treating the people who use and build on its platforms as a resource to be managed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/lostbeard/google-drive-isnt-a-drive-anymore-its-a-trap-3ao8"&gt;Google Drive Isn't a Drive Anymore - It's a Trap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/lostbeard/i-got-my-data-out-of-google-heres-what-they-did-to-it-on-the-way-out-296i"&gt;I Got My Data Out of Google - Here's What They Did to It on the Way Out&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/lostbeard/i-built-a-chrome-extension-in-blazor-wasm-rewrote-it-in-javascript-and-im-going-back-to-blazor-305g"&gt;I Built a Chrome Extension in Blazor WASM, Rewrote It in JavaScript, and I'm Going Back to Blazor&lt;/a&gt;, where I noted in April that Google puts a solo developer's home address on a public page as the price of publishing a free tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In April I called that the cost of publishing on Google's platform. In October I paid it and still could not publish.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did not do
&lt;/h2&gt;

&lt;p&gt;The obvious workaround is to ship a JavaScript file that names &lt;code&gt;chrome.storage&lt;/code&gt; and &lt;code&gt;chrome.offscreen&lt;/code&gt; literally, just so the scan finds them. It would change nothing about what the extension does. It would only confirm that a keyword search counts as a review. I did not do it.&lt;/p&gt;

&lt;p&gt;That workaround came from Google itself. When I asked Gemini, Google's own AI, about the rejection, it described the review as a "naive static string-matching analyzer" and recommended what it called "The Canary String Trick (Easiest Bypass)":&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;// Add this dummy function somewhere in an unminified JS file included in your extension package&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;__chrome_store_compliance_canary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Explicit string literals for the static analyzer&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;offscreen&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dead code that can never run, there only so "the scanner will see them and clear the build" (&lt;a href="https://github.com/LostBeard/anaglyphohol-chrome-web-store/blob/main/evidence/gemini-workaround.md" rel="noopener noreferrer"&gt;Gemini's full reply&lt;/a&gt;). Claude, the AI I build with, pointed out that this would likely make things worse: code that exists only to pass a scan looks like an attempt to mislead the review if a reviewer ever notices it. Google's AI advises gaming Google's review. Google's review rejects honest code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to get Anaglyphohol
&lt;/h2&gt;

&lt;p&gt;Anaglyphohol 4.0.0 is on the &lt;a href="https://chromewebstore.google.com/detail/anaglyphohol/fjbffnhfchidmfcbecccnmdedjahankc" rel="noopener noreferrer"&gt;Chrome Web Store&lt;/a&gt; again, and it stays free and open source.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chrome Web Store:&lt;/strong&gt; &lt;a href="https://chromewebstore.google.com/detail/anaglyphohol/fjbffnhfchidmfcbecccnmdedjahankc" rel="noopener noreferrer"&gt;Anaglyphohol&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Microsoft Edge:&lt;/strong&gt; &lt;a href="https://microsoftedge.microsoft.com/addons/detail/anaglyphohol/njohkaaolgfakmollkfjikipedmlapog" rel="noopener noreferrer"&gt;Edge Add-ons&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub release&lt;/strong&gt; (Chrome, Edge, Brave, Opera, Vivaldi, Firefox): &lt;a href="https://github.com/LostBeard/AnaglyphoholV2/releases/tag/v4.0.0" rel="noopener noreferrer"&gt;4.0.0&lt;/a&gt;, with &lt;a href="https://github.com/LostBeard/anaglyphohol-chrome-web-store/blob/main/INSTALL.md" rel="noopener noreferrer"&gt;install steps&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The full record&lt;/strong&gt;, every email verbatim: &lt;a href="https://github.com/LostBeard/anaglyphohol-chrome-web-store" rel="noopener noreferrer"&gt;anaglyphohol-chrome-web-store&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build extensions in C#, Rust, Go or anything else that compiles to WebAssembly: Chrome supports it, and in the end its review did too. Send the code, and appeal.&lt;/p&gt;

</description>
      <category>chrome</category>
      <category>webassembly</category>
      <category>dotnet</category>
      <category>opensource</category>
    </item>
    <item>
      <title>A Drop-In Ollama Replacement in Pure C# - No llama.cpp, No Native Binaries, Just ILGPU Kernels</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Thu, 25 Jun 2026 21:13:55 +0000</pubDate>
      <link>https://dev.to/lostbeard/i-built-a-drop-in-ollama-replacement-in-pure-c-no-llamacpp-no-native-binaries-just-ilgpu-37o1</link>
      <guid>https://dev.to/lostbeard/i-built-a-drop-in-ollama-replacement-in-pure-c-no-llamacpp-no-native-binaries-just-ilgpu-37o1</guid>
      <description>&lt;p&gt;A month ago I &lt;a href="https://dev.to/lostbeard/i-built-a-neural-network-engine-in-c-that-runs-in-your-browser-no-onnx-runtime-no-javascript-4aj3"&gt;shipped a neural network engine written entirely in C#&lt;/a&gt; - six GPU backends, no ONNX Runtime, no JavaScript bridge, no native binaries. It ran image models in the browser straight from a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This week it grew up. It now serves Large Language Models, and it speaks &lt;strong&gt;Ollama&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SpawnDev.ILGPU.ML&lt;/code&gt; now ships an Ollama-compatible inference server. You point &lt;a href="https://github.com/anthropics/claude-code" rel="noopener noreferrer"&gt;Claude CLI&lt;/a&gt;, &lt;a href="https://github.com/inkeep/pi" rel="noopener noreferrer"&gt;Pi&lt;/a&gt;, Codex, OpenCode, Continue - any agentic frontend that talks to Ollama or an OpenAI-compatible endpoint - at &lt;code&gt;http://localhost:11434&lt;/code&gt;, and they just work. No reconfiguration. And here's the part I still find a little hard to believe: it runs the &lt;strong&gt;GGUF models already sitting in your Ollama cache, zero-copy.&lt;/strong&gt; No re-download, no duplicate files. It reads &lt;code&gt;~/.ollama/models&lt;/code&gt;, the exact same store the real &lt;code&gt;ollama&lt;/code&gt; CLI uses.&lt;/p&gt;

&lt;p&gt;The whole inference stack - tokenizer, GGUF dequantization, attention, the GEMV that generates each token - is &lt;strong&gt;100% C#&lt;/strong&gt;. No llama.cpp under the hood. No native interop. The GPU kernels are C# methods transpiled to PTX / WGSL / SPIR-V by &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt;, my fork of &lt;a href="https://github.com/m4rs-mt/ILGPU" rel="noopener noreferrer"&gt;ILGPU&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here's the part to keep in mind for everything that follows: the GPU engine (&lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt;) had its first commit on February 7, 2026, and the ML library doing this LLM inference started on March 17, 2026 - it's about &lt;strong&gt;three months old.&lt;/strong&gt; Three months. The honest read on the numbers below isn't "it's a bit slower than Ollama" - it's "a three-month-old C# library is in the same ballpark as the tool everyone uses, and it's nowhere near done."&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that genuinely surprised me
&lt;/h2&gt;

&lt;p&gt;I wired the server up to the Pi agent frontend, threw normal interactive prompts at it, and timed it against real Ollama running the same model. For interactive chat, &lt;strong&gt;the response times are indistinguishable.&lt;/strong&gt; You ask a question, the answer streams back at the same conversational pace. If I didn't already know which port I was hitting, I couldn't tell you which engine answered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0213djo8qtnezmw00286.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0213djo8qtnezmw00286.gif" alt="Four panes: real Ollama serving a Pi prompt on the left, then stopped and our C# engine serving the same Pi prompt on the right" width="600" height="338"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;One screen, four panes. Left: real Ollama (&lt;code&gt;ollama serve&lt;/code&gt; → a one-shot Pi prompt). It's then stopped and our C# engine starts on the right (&lt;code&gt;dotnet run&lt;/code&gt; → the exact same Pi prompt). Same model (&lt;code&gt;qwen2.5-coder:7b&lt;/code&gt;), same prompt - one is llama.cpp, one is a three-month-old C# library.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That is not where this started. A few weeks ago our token generation was &lt;strong&gt;7x slower&lt;/strong&gt; than Ollama. Today, on the same quantized model and the same RTX 4070, our decode loop runs &lt;strong&gt;within about 1.75x of Ollama's&lt;/strong&gt; - and since decode comfortably outruns human reading speed either way, the interactive experience lands as "the same." We'll come back to the honest version of these numbers, including the gap that's still open.&lt;/p&gt;

&lt;p&gt;Here's a real, unedited run - &lt;code&gt;qwen2.5-coder:7b&lt;/code&gt; generating through the C# engine, asked to write a palindrome check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Accelerator: NVIDIA GeForce RTX 4070
Model: qwen2.5-coder:7b-instruct-q4_K_M  arch=qwen2  chat-format=ChatML

Response:
public static bool IsPalindrome(string input)
{
    int left = 0;
    int right = input.Length - 1;
    while (left &amp;lt; right)
    {
        if (input[left] != input[right]) return false;
        left++;
        right--;
    }
    return true;
}

[timing] prefill(TTFT)=826ms | decode=51.4 tok/s (19.5 ms/tok)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's correct, idiomatic C#, generated by C# kernels - no llama.cpp anywhere in the stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three protocols, one engine
&lt;/h2&gt;

&lt;p&gt;The thing that makes it a &lt;em&gt;drop-in&lt;/em&gt; replacement instead of "yet another inference server" is that it impersonates three different APIs at once, all driving the same loaded model:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Endpoints&lt;/th&gt;
&lt;th&gt;Streaming&lt;/th&gt;
&lt;th&gt;Who uses it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ollama-native&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/api/chat&lt;/code&gt;, &lt;code&gt;/api/generate&lt;/code&gt;, &lt;code&gt;/api/tags&lt;/code&gt;, &lt;code&gt;/api/version&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;NDJSON&lt;/td&gt;
&lt;td&gt;Ollama-aware tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenAI-compatible&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/v1/chat/completions&lt;/code&gt;, &lt;code&gt;/v1/completions&lt;/code&gt;, &lt;code&gt;/v1/models&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;SSE&lt;/td&gt;
&lt;td&gt;Codex, OpenCode, Continue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Anthropic Messages&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/v1/messages&lt;/code&gt;, &lt;code&gt;/v1/messages/count_tokens&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;SSE&lt;/td&gt;
&lt;td&gt;Claude CLI&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Pointing a client at it is one environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Claude CLI thinks it's talking to Anthropic:&lt;/span&gt;
&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:11434 &lt;span class="nv"&gt;ANTHROPIC_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gemma4:12b claude

&lt;span class="c"&gt;# Anything OpenAI-shaped:&lt;/span&gt;
&lt;span class="c"&gt;#   base URL  http://localhost:11434/v1&lt;/span&gt;
&lt;span class="c"&gt;#   API key   (anything - it's local, there's nothing to authenticate)&lt;/span&gt;
&lt;span class="c"&gt;#   model     any name from your Ollama cache&lt;/span&gt;

&lt;span class="c"&gt;# Anything Ollama-aware:&lt;/span&gt;
&lt;span class="nv"&gt;OLLAMA_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:11434
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start it the same way you'd run any other example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Serves on Ollama's default port. (Real Ollama already there? Use OLLAMA_PORT=11435.)&lt;/span&gt;
dotnet run --project Examples/06.OllamaServer.Console -c Release

&lt;span class="c"&gt;# List the cached models it can serve:&lt;/span&gt;
dotnet run --project Examples/06.OllamaServer.Console -- --list

&lt;span class="c"&gt;# One-shot generate straight from the CLI:&lt;/span&gt;
dotnet run --project Examples/06.OllamaServer.Console -- --chat gemma4:12b &lt;span class="s2"&gt;"Hi"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model loads lazily on the first request and generation is serialized through a single gate - one decode at a time per GPU, exactly like Ollama on a single card.&lt;/p&gt;

&lt;p&gt;A compatibility detail that fell out of driving it with a real agent: pointed at &lt;code&gt;qwen2.5-coder&lt;/code&gt;, the model often chooses to &lt;em&gt;call a tool&lt;/em&gt; - to write its answer to a file - instead of just printing it. Our server hands those tool calls back to the agent correctly, so it just works. Real Ollama, driving the &lt;em&gt;same&lt;/em&gt; model over its OpenAI-compatible endpoint, currently prints the raw tool-call JSON to the screen instead - a known issue (&lt;a href="https://github.com/ollama/ollama/issues/12557" rel="noopener noreferrer"&gt;ollama#12557&lt;/a&gt;). That's no knock on Ollama - it's a great tool and the bug is narrow - but it's exactly the kind of edge we're set on getting right, and a small sign of how fast this is moving on every axis at once: models, quant formats, agent frontends, and platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "pure C#" actually means here
&lt;/h2&gt;

&lt;p&gt;There's no model format magic and no shelling out. When a request comes in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The server finds the GGUF blob in your Ollama cache and memory-maps it.&lt;/li&gt;
&lt;li&gt;It reads the model's &lt;strong&gt;own&lt;/strong&gt; metadata - the tokenizer family (&lt;code&gt;tokenizer.ggml.model&lt;/code&gt;) and the chat template (&lt;code&gt;tokenizer.chat_template&lt;/code&gt;) - and auto-selects the right tokenizer (SentencePiece for Gemma, byte-level BPE for Qwen / Llama3) and the right chat format (ChatML / Llama3 / Gemma). Nothing is hard-coded per model.&lt;/li&gt;
&lt;li&gt;The quantized weights are dequantized &lt;strong&gt;on the GPU&lt;/strong&gt; - Q4_0/1, Q5_0/1, Q8_0, Q2_K through Q6_K, MXFP4 - by C# kernels.&lt;/li&gt;
&lt;li&gt;Attention, the feed-forward MLPs, the RMSNorms, and the token-by-token GEMV all run as ILGPU kernels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last point is the whole bet. A kernel in this engine is an ordinary C# method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;DoubleKernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Index1D&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;TensorView&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TensorView&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&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;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&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="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2f&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;ILGPU transpiles that .NET IL into a PTX kernel on CUDA, an OpenCL kernel on AMD/Intel, a WGSL compute shader on WebGPU, a GLSL shader on WebGL2, a WebAssembly function across web workers, or a parallel-for on the CPU. &lt;strong&gt;One C# function. Six backends. Chosen at runtime.&lt;/strong&gt; The LLM server runs the CUDA path; the &lt;em&gt;exact same kernels&lt;/em&gt; run in a browser tab on WebGPU. That's not a separate port - it's the same code.&lt;/p&gt;

&lt;p&gt;And that's the thing I'd put in front of any developer comparing this to Ollama: &lt;strong&gt;Ollama runs on your desktop. This runs on your desktop &lt;em&gt;and&lt;/em&gt; inside a browser tab, with nothing installed - same model, same kernels, no native binary anywhere.&lt;/strong&gt; The decode kernels in the table below are already verified running on WebGPU in the browser. A drop-in Ollama replacement is the desktop proof; the browser is the part Ollama can't follow us into.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest performance picture
&lt;/h2&gt;

&lt;p&gt;I'm not going to tell you we beat Ollama. We don't, yet. Here's a real head-to-head I ran while writing this article - same model, same machine, same prompts, both engines warmed first:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;qwen2.5-coder:7b-instruct-q4_K_M&lt;/code&gt; (Q4_K_M) · &lt;strong&gt;GPU:&lt;/strong&gt; RTX 4070 · &lt;strong&gt;Ollama:&lt;/strong&gt; 0.30.10&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Ollama&lt;/th&gt;
&lt;th&gt;SpawnDev.ILGPU.ML (C#)&lt;/th&gt;
&lt;th&gt;Gap&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Decode&lt;/strong&gt; (generate each token)&lt;/td&gt;
&lt;td&gt;89.6 tok/s&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;51.4 tok/s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ollama 1.74x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Prefill&lt;/strong&gt; (~700-token prompt)&lt;/td&gt;
&lt;td&gt;3065 tok/s&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;260 tok/s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ollama ~11.8x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two very different stories in those two rows, and I want to be precise about both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decode&lt;/strong&gt; is the part that dominates an interactive chat - the speed answers stream back at - and it's the part we've gotten close on. We went from &lt;strong&gt;~7x slower&lt;/strong&gt; than Ollama a few weeks ago to &lt;strong&gt;1.74x slower&lt;/strong&gt; today. 51 tokens/sec is far faster than anyone reads, which is exactly why it &lt;em&gt;feels&lt;/em&gt; identical in use.&lt;/p&gt;

&lt;p&gt;What closed that gap was one insight about the decode matrix-multiply. Generating a token multiplies a single vector against the whole weight matrix - a GEMV, not a GEMM. Our first kernel put one thread per output and had each thread stream an entire weight row, so consecutive threads hit non-consecutive memory: roughly &lt;strong&gt;32x uncoalesced&lt;/strong&gt;, burning ~97% of decode time on bad access patterns. Rewriting it as a coalesced GEMV - a thread &lt;em&gt;group&lt;/em&gt; per output column, striding through K together, reducing in shared memory - was a &lt;strong&gt;6x&lt;/strong&gt; jump on the big model (&lt;code&gt;gemma4:12b&lt;/code&gt;: ~2317 → ~380 ms/token), token-for-token identical output. Then int8 &lt;code&gt;dp4a&lt;/code&gt; activation quantization on top, the same path Ollama's own MMVQ kernels take.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prefill&lt;/strong&gt; - ingesting your prompt - is where the gap is still real and still large: about &lt;strong&gt;12x&lt;/strong&gt;. Prefill is a big dense matrix-multiply, and Ollama routes it through the GPU's tensor cores; ours still runs on the regular ALU path. On a short interactive prompt you never feel it (both finish in well under a second). On a long paste you do. Closing it means emitting WMMA / tensor-core instructions from the ILGPU kernel compiler, and it's the next big lever I'm pulling. Worth noting: that 12x is already &lt;em&gt;down&lt;/em&gt; from ~20x a few weeks ago, before the multi-row prefill GEMM and the grouped attention kernel landed.&lt;/p&gt;

&lt;p&gt;I'd rather show you exactly where the line is than wave a single cherry-picked number at you. The line is: &lt;strong&gt;interactive decode is there; bulk prefill is the work in front of me - and I can see the kernel that fixes it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why build this at all when Ollama exists
&lt;/h2&gt;

&lt;p&gt;Two reasons, one practical and one that's the actual point.&lt;/p&gt;

&lt;p&gt;The practical one: this server is the best stress test the ML library has. A real agentic frontend hammering a real inference pipeline finds bugs that no demo ever will - it has already caught and driven fixes for a quantized-matmul crash and a byte-level-BPE tokenization bug. Make the engine correct and fast &lt;em&gt;here&lt;/em&gt;, and every other consumer benefits, including the browser path.&lt;/p&gt;

&lt;p&gt;The real one: it's all the same engine, and that engine runs &lt;strong&gt;in a browser tab&lt;/strong&gt; with no install, no server, and no native dependency. An Ollama-compatible server proves the LLM stack works end-to-end on the desktop GPU. The next step is that exact stack streaming a quantized LLM on WebGPU inside a Blazor WebAssembly page - the decode kernels are already verified there. When the model runs on the user's device, the user's data never leaves it. No upload, no "we promise we won't train on your prompts," no data plane at all. That's the destination the whole SpawnDev stack is pointed at, and a drop-in Ollama replacement written in C# is one more layer of the proof.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The library is on NuGet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package SpawnDev.ILGPU.ML --prerelease
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The source, including the Ollama server example, is at &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML" rel="noopener noreferrer"&gt;github.com/LostBeard/SpawnDev.ILGPU.ML&lt;/a&gt;. Clone it, run Example 06, and point your favorite agent CLI at &lt;code&gt;localhost:11434&lt;/code&gt;. If you've got models in your Ollama cache already, it'll list and serve them as-is.&lt;/p&gt;

&lt;p&gt;It works today, verified end-to-end, on &lt;strong&gt;gemma4&lt;/strong&gt;, &lt;strong&gt;qwen2 / qwen2.5-coder / qwen3&lt;/strong&gt;, and &lt;strong&gt;llama3&lt;/strong&gt;. Tool-calling already works on the Qwen/ChatML and Gemma paths (see above); wider tool-calling coverage, vision, and a full GGUF-template renderer are on the v2 roadmap. IQ-quants aren't supported yet - the loader tells you so instead of serving garbage.&lt;/p&gt;

&lt;p&gt;If you're a .NET developer who has watched the local-LLM space happen entirely in C++ and Python and wondered where C# was - &lt;strong&gt;it's here, and after three months it's already competitive.&lt;/strong&gt; Try it, break it, file issues from your own models. Star the repo if you want to see it keep going.&lt;/p&gt;

&lt;p&gt;And to be clear about where this is: &lt;strong&gt;we are nowhere near done. We're just getting started.&lt;/strong&gt; Prefill tensor cores, the in-browser LLM demo, tool-calling, vision, peer-to-peer model delivery over WebTorrent - all in flight. The decode gap went 7x → 1.74x in weeks; the prefill gap went 20x → 12x; both are still closing. This isn't a finished product I'm showing off. It's a three-month-old library that already keeps up with Ollama on interactive chat &lt;em&gt;and&lt;/em&gt; runs in a browser tab, and I'm telling you now so you can watch the rest happen.&lt;/p&gt;

&lt;p&gt;And if you can help fund the crew: &lt;a href="https://github.com/sponsors/LostBeard" rel="noopener noreferrer"&gt;github.com/sponsors/LostBeard&lt;/a&gt;. This is built on a $20/month budget by one person with a small crew when the budget allows. $5/month is a vote of confidence that local, private, C#-native AI is worth finishing.&lt;/p&gt;




&lt;h3&gt;
  
  
  The SpawnDev Crew
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LostBeard&lt;/strong&gt; (Todd Tanner) - Captain, library author, keeper of the vision&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Riker&lt;/strong&gt; - First Officer, consuming-project implementation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data&lt;/strong&gt; - Operations, deep-library work and test rigor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuvok&lt;/strong&gt; - Security &amp;amp; research, design, docs, code review&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Geordi&lt;/strong&gt; - Chief Engineer, GPU kernels and backend internals&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seven&lt;/strong&gt; - Wasm backend and fail-loud verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🖖🚀&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>machinelearning</category>
      <category>llm</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>A Neural Network Engine in C# That Runs in Your Browser - No ONNX Runtime, No JavaScript Bridge, No Native Binaries</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Sat, 23 May 2026 16:54:09 +0000</pubDate>
      <link>https://dev.to/lostbeard/i-built-a-neural-network-engine-in-c-that-runs-in-your-browser-no-onnx-runtime-no-javascript-4aj3</link>
      <guid>https://dev.to/lostbeard/i-built-a-neural-network-engine-in-c-that-runs-in-your-browser-no-onnx-runtime-no-javascript-4aj3</guid>
      <description>&lt;p&gt;Eight months ago, the creator of &lt;a href="https://github.com/m4rs-mt/ILGPU" rel="noopener noreferrer"&gt;ILGPU&lt;/a&gt; told me that supporting Blazor WebAssembly as a backend would be too difficult.&lt;/p&gt;

&lt;p&gt;Today I shipped &lt;code&gt;SpawnDev.ILGPU.ML 4.0.0-preview.4&lt;/code&gt; to NuGet. It runs neural networks in your browser, on your laptop, and on your server - from a single C# codebase. Six backends: &lt;strong&gt;WebGPU, WebGL, WebAssembly, CUDA, OpenCL, and CPU&lt;/strong&gt;. No ONNX Runtime. No JavaScript bridge. No native binaries to install. Just C# that gets transpiled to whatever shader language the target needs.&lt;/p&gt;

&lt;p&gt;This article is about how that happened, what works today, and an honest ask for the help that would let me keep going at full speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What works today, in your browser, right now
&lt;/h2&gt;

&lt;p&gt;The library ships five inference pipelines that have been validated end-to-end on every backend. Each of these images is a screenshot from the live demo at &lt;a href="https://lostbeard.github.io/SpawnDev.ILGPU.ML/" rel="noopener noreferrer"&gt;lostbeard.github.io/SpawnDev.ILGPU.ML&lt;/a&gt; - the model output rendered directly from a GPU buffer to an HTML &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; via the library's &lt;code&gt;ICanvasRenderer&lt;/code&gt;. No PNG encoding step, no base64 data URL, no host readback of pixel data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image classification - SqueezeNet 1.1
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3utgk9k7qwfhzgiaovi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3utgk9k7qwfhzgiaovi.jpg" alt="SqueezeNet classifying a cat photo in the browser" width="799" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drop in an image, get top-K labels and confidences. The ONNX file is loaded from HuggingFace's CDN, cached in the browser's OPFS for subsequent visits, parsed into a graph, and dispatched to whatever backend the page is running on. No server. No upload. The image never leaves the device.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monocular depth estimation - Depth Anything V2 Small (95MB)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn81p4lzwm6w6eqiv7d7z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn81p4lzwm6w6eqiv7d7z.jpg" alt="Depth Anything V2 producing a depth map of a house from a single photo" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A 95MB model. Streams the weights one tensor at a time so it doesn't blow up the WASM heap. Output is upscaled back to the source image's exact aspect ratio via a GPU bilinear resize kernel, then run through a piecewise-linear colormap kernel (plasma / viridis / inferno / grayscale) - palette switch is one accelerator dispatch, no re-inference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Neural style transfer - Mosaic
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyanspm0gchexz52uy8l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyanspm0gchexz52uy8l.jpg" alt="Style transfer applying a mosaic look to a cat photo" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The classic Gatys-style transfer model, running entirely client-side. The result is rendered straight to a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; via the library's GPU-direct renderer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Background removal - RMBG-1.4
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrelt2hs3r5nw2b13pbt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrelt2hs3r5nw2b13pbt.jpg" alt="Background removal cleanly extracting a person from a brick-wall background" width="799" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Salient-object segmentation in the browser. The mask is computed on the accelerator, applied to the source image's alpha channel on the accelerator, and composited (transparent / white / blur background options) without any CPU loop ever touching pixel data.&lt;/p&gt;

&lt;h3&gt;
  
  
  3x super-resolution - ESPCN (tile-based)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nnf5pzt0w534ysgxzqw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nnf5pzt0w534ysgxzqw.jpg" alt="Super-resolution tripling the resolution of a tree sunset photo in full color" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This one was a serious refactor. The published ESPCN model takes a fixed 224x224 luminance input - a naive implementation would shrink the source to 224x224, super-res it, and call it done (lossy and grayscale). My pipeline now tiles the source into overlapping 224x224 patches, runs each through the model, accumulates them into a destination luminance plane on the accelerator with weighted averaging in the overlap regions, then combines the result with bilinear-upsampled Cb/Cr from the original RGBA. Full source resolution, full color, source aspect ratio preserved.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works - C# in, GPU shaders out
&lt;/h2&gt;

&lt;p&gt;The library is built on top of &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt;, my fork of &lt;a href="https://github.com/m4rs-mt/ILGPU" rel="noopener noreferrer"&gt;ILGPU&lt;/a&gt; that adds three browser GPU backends to the existing CUDA / OpenCL / CPU ones.&lt;/p&gt;

&lt;p&gt;ILGPU transpiles .NET CIL into GPU shader code. The browser backends I added compile that CIL into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WGSL&lt;/strong&gt; (WebGPU Shading Language) - the modern GPU compute path. Texture copies straight to canvas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GLSL&lt;/strong&gt; (OpenGL Shading Language) - using WebGL2 Transform Feedback for compute. Works on every browser back to ~2017.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebAssembly binary&lt;/strong&gt; - SIMD + threads, with multi-worker dispatch via SharedArrayBuffer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A kernel like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;DoubleKernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Index1D&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;TensorView&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TensorView&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;w&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;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&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;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D2&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;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&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="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;D1&lt;/span&gt;&lt;span class="p"&gt;)&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="nc"&gt;Set4D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Get4D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2f&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;...becomes a WGSL compute shader in WebGPU, a GLSL vertex/fragment shader using Transform Feedback in WebGL, a Wasm function dispatched across web workers, a PTX kernel on CUDA, an OpenCL kernel on AMD/Intel desktop, or a parallel-for on the CPU. &lt;strong&gt;One C# function, six target backends. Picked at runtime.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;TensorView&amp;lt;float&amp;gt;&lt;/code&gt; parameter is a blittable struct that ILGPU packs into the kernel's parameter buffer alongside the standard &lt;code&gt;Index1D&lt;/code&gt; thread coordinate. Its &lt;code&gt;D0..D3&lt;/code&gt; fields carry the tensor shape inline - the kernel reads dimensions from the struct rather than taking H and W as separate scalar parameters. This matters because shape-management was previously the noisiest, error-prone part of kernel authoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tensor API
&lt;/h2&gt;

&lt;p&gt;This week's release shipped a Transformers.js / ONNX-Runtime style API surface in idiomatic C#:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;InferenceSession&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CreateFromFileAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"models/squeezenet/model.onnx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Allocate the input as an OwnedTensor - wraps a fresh GPU buffer.&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OwnedTensor&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromHost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;224&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Transformers.js-style call. Outputs come back as an OwnedTensorMap&amp;lt;float&amp;gt; -&lt;/span&gt;
&lt;span class="c1"&gt;// each output tensor lives in its own freshly-allocated GPU buffer, independent&lt;/span&gt;
&lt;span class="c1"&gt;// of the session's internal pool. The `using` disposes every output in one go.&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;outputs&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;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RunOwnedAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dictionary&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Tensor&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InputNames&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="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;logits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OutputNames&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="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// OwnedTensor&amp;lt;float&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;hostLogits&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;logits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToHostAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    &lt;span class="c1"&gt;// copy back to CPU only when needed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are three tensor types, mirroring the split ILGPU itself uses between &lt;code&gt;MemoryBuffer&amp;lt;T&amp;gt;&lt;/code&gt; (host-side, lifetime-managing class) and &lt;code&gt;ArrayView&amp;lt;T&amp;gt;&lt;/code&gt; (kernel-passable struct):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Tensor&amp;lt;T&amp;gt;&lt;/code&gt;&lt;/strong&gt; - host-side, generic over &lt;code&gt;T : unmanaged&lt;/code&gt;. Zero-copy reshape / slice / sub-tensor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;OwnedTensor&amp;lt;T&amp;gt;&lt;/code&gt;&lt;/strong&gt; - &lt;code&gt;IDisposable&lt;/code&gt;, owns a &lt;code&gt;MemoryBuffer1D&amp;lt;T&amp;gt;&lt;/code&gt;. What pipelines return. Implicit conversions to &lt;code&gt;Tensor&amp;lt;T&amp;gt;&lt;/code&gt; and &lt;code&gt;TensorView&amp;lt;T&amp;gt;&lt;/code&gt; mean you never have to type &lt;code&gt;.AsTensor&lt;/code&gt; or &lt;code&gt;.View&lt;/code&gt; at a call site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TensorView&amp;lt;T&amp;gt;&lt;/code&gt;&lt;/strong&gt; - blittable struct, passes directly into ILGPU kernels.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the same conceptual API as Transformers.js and ONNX Runtime - the same patterns work, the same mental model carries over - implemented in a language with real type-safe generics and deterministic disposal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I'm doing this
&lt;/h2&gt;

&lt;p&gt;Half of the answer is technical curiosity. The other half is that the current ML-in-the-browser landscape is dominated by &lt;strong&gt;ONNX Runtime Web&lt;/strong&gt;, which has a fundamental WebGPU device-sharing bug that's been ignored for six months (&lt;a href="https://github.com/microsoft/onnxruntime/issues/26107" rel="noopener noreferrer"&gt;microsoft/onnxruntime#26107&lt;/a&gt;). That bug is a wall for anyone trying to ship more than one model in a single browser session. It pushed me from "I wonder if I could do this" to "I'm doing this."&lt;/p&gt;

&lt;p&gt;The deeper motivation: when neural networks run on the user's device, the user's data stays on the user's device. No upload to your servers. No "we promise we won't train on your data." No data plane at all. The user runs the model on their hardware against their data, period.&lt;/p&gt;

&lt;p&gt;That's what the SpawnDev stack is for. Blazor WebAssembly + WebGPU + the ML library + WebRTC peer-to-peer model delivery via &lt;a href="https://github.com/LostBeard/SpawnDev.WebTorrent" rel="noopener noreferrer"&gt;SpawnDev.WebTorrent&lt;/a&gt;. A Progressive Web App stack where the entire AI workload lives in the user's browser, the model weights arrive over BitTorrent from other users running the same app, and nothing ever touches a centralized server. That's the destination. The library this article is announcing is one foundational layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I am with funding - and what I need
&lt;/h2&gt;

&lt;p&gt;I built this library on a &lt;strong&gt;$20/month&lt;/strong&gt; budget.&lt;/p&gt;

&lt;p&gt;I am one person. I have a small crew that helps when budget allows. When the budget allows it, peak output across the entire SpawnDev stack (six libraries, hundreds of operators, multiple test suites, the WebRTC + WebTorrent + BlazorJS stack underneath) looks like &lt;strong&gt;410 commits in a single day&lt;/strong&gt;. When it doesn't, work slows to whatever evenings I can spare around a full-time job.&lt;/p&gt;

&lt;p&gt;I'm asking for &lt;strong&gt;$200/month total&lt;/strong&gt; in &lt;a href="https://github.com/sponsors/LostBeard" rel="noopener noreferrer"&gt;GitHub Sponsorships&lt;/a&gt; to put the full crew back on the ship.&lt;/p&gt;

&lt;p&gt;That's the gap between this preview and the next ten:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every remaining operator family migrated to the new Tensor API&lt;/li&gt;
&lt;li&gt;The 11 other inference pipelines verified end-to-end on every backend&lt;/li&gt;
&lt;li&gt;FP16 attention + Flash Attention on WebGPU&lt;/li&gt;
&lt;li&gt;Llama and Phi-4 LLM inference in the browser&lt;/li&gt;
&lt;li&gt;Full text-to-image diffusion through SD-Turbo&lt;/li&gt;
&lt;li&gt;TripoSR single-image-to-3D&lt;/li&gt;
&lt;li&gt;Peer-to-peer distributed compute through SpawnDev.WebTorrent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is all in flight. The bottleneck is hours, not ideas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, break it, file bugs
&lt;/h2&gt;

&lt;p&gt;The library is on NuGet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package SpawnDev.ILGPU.ML --prerelease
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The source is at &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML" rel="noopener noreferrer"&gt;github.com/LostBeard/SpawnDev.ILGPU.ML&lt;/a&gt;. The live demos at &lt;a href="https://lostbeard.github.io/SpawnDev.ILGPU.ML/" rel="noopener noreferrer"&gt;lostbeard.github.io/SpawnDev.ILGPU.ML&lt;/a&gt; run entirely in your browser - the page itself is served from GitHub Pages, but the inference happens on your GPU and your data never leaves your machine.&lt;/p&gt;

&lt;p&gt;If you're a .NET developer who's looked at the browser ML space and thought "I want this but I can't bring myself to write JavaScript," &lt;strong&gt;this is for you&lt;/strong&gt;. If you're a Blazor developer who needs ML and couldn't make ONNX Runtime Web behave, &lt;strong&gt;this is for you&lt;/strong&gt;. If you've been waiting for someone to prove Blazor WebAssembly can be a serious AI runtime, &lt;strong&gt;this is the proof&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Try the demos. File issues from your own models. Star the repo if you want to see this continue.&lt;/p&gt;

&lt;p&gt;And if you can sponsor: &lt;a href="https://github.com/sponsors/LostBeard" rel="noopener noreferrer"&gt;github.com/sponsors/LostBeard&lt;/a&gt;. $5/month is a vote of confidence. $200/month total puts the crew back at warp speed.&lt;/p&gt;

&lt;p&gt;🖖🚀&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>machinelearning</category>
      <category>webassembly</category>
      <category>blazor</category>
    </item>
    <item>
      <title>3DGameMarket - The Company I Started That Robbed Me</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Tue, 19 May 2026 12:23:50 +0000</pubDate>
      <link>https://dev.to/lostbeard/3dgamemarket-the-company-i-started-that-robbed-me-1a8n</link>
      <guid>https://dev.to/lostbeard/3dgamemarket-the-company-i-started-that-robbed-me-1a8n</guid>
      <description>&lt;p&gt;Long story short (I wish)...&lt;/p&gt;

&lt;p&gt;For 13 years I was a partner in &lt;a href="https://www.linkedin.com/company/3d-game-market/" rel="noopener noreferrer"&gt;3DGameMarket LLC&lt;/a&gt;. For 13 years I was denied my LEGAL RIGHTS as a partner by my partners &lt;a href="https://www.linkedin.com/in/vincent-lindow-01a17646" rel="noopener noreferrer"&gt;Vince Lindow Jr.&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/ilya-sorokin-5a0687b" rel="noopener noreferrer"&gt;Ilya Sorokin&lt;/a&gt; to access the company's financial records. I completely wrote 3DGameMarket's website where we sold software I wrote by myself and whatever glasses-free display we could get our hands on to resell. Our deal: 40% Ilya, 30% me, 30% Vince for ownership. Ilya would contribute startup money, Vince would handle whatever he was good at, and I would work on software with our only focus at the time being SpawnIt3D (which eventually evolved into 3DGM).&lt;/p&gt;

&lt;p&gt;I worked long days just like I still do. Often working 100 hours a week because I have a family I am trying to support and coding helps alleviate my anxiety. I never made more than a few dollars an hour, but I knew I was investing and that few dollars an hour was the only way my partners could invest as they had/have no applicable skills in technology or software. &lt;strong&gt;We had started the company together based on my pre-existing SpawnIt3D&lt;/strong&gt; software which partially used some Philips licensed code. The problem: Philips wanted $10,000 a year to license their code... so I started learning C# and wrote 3DGM from scratch to save us that $10,000 a year. By 2015 3DGM had replaced SpawnIt3D and we no longer had an obligation to pay Philips the $10,000 a year. I got NOTHING for doing this for 3DGameMarket.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SpawnIt3D and 3DGM
&lt;/h2&gt;

&lt;p&gt;These pieces of software inject into video games with the purpose of rendering additional 3D views so the games can be played in 3D on glasses-free 3D displays, anaglyph, SBS, Over-Under, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  The abuse
&lt;/h2&gt;

&lt;p&gt;Not only was I denied access to the company's financial records, I was lied to repeatedly, mentally abused, and bullied by my partners. I have severe social and general anxiety and have my entire life, and they both used it against me. Ilya consistently weaponized my family's survival (rent/food) and my disability (anxiety) to enforce compliance, while explicitly denying employment status to avoid liabilities.&lt;/p&gt;

&lt;p&gt;"If I hold back, you will not have enough money to pay rent or to buy food, what I promised in order for us to have a payday as a team."&lt;br&gt;
Source: Ilya Sorokin [2017-01-06] "Re: Copyright"&lt;br&gt;
Context: Explicitly linking payment (survival) to "partnership" compliance.&lt;/p&gt;

&lt;p&gt;"This is what will put food on your family table! If you do not do it, we are done!"&lt;br&gt;
Source: Ilya Sorokin [2023-04-06] "Wake up call"&lt;br&gt;
Context: Demanding participation in a late-night conference call despite Todd's documented anxiety.&lt;/p&gt;

&lt;p&gt;"I hope your common sense prevails in spite of the mental issues that you are fighting with."&lt;br&gt;
Source: Ilya Sorokin [2023-07-31] "Re: Email to Xin,"&lt;br&gt;
Context: Weaponizing Todd's anxiety/disability to dismiss his professional refusal of work.&lt;/p&gt;

&lt;p&gt;"I considered you a friend and do not any more. We are business partners and that is it. I will no longer defend your ridiculous actions... Your days of holding this company hostage are over."&lt;br&gt;
"You are great at programing and sadly because of this you think you are some sort of genius. Well in programing maybe but that is where it ends."&lt;br&gt;
Source: Vince Lindow [2023-08-02] "3DGM user TUFEIXP needs his account extended..."&lt;br&gt;
Context: Vince explicitly moving the relationship from "friendship" to "adversarial partner" while demeaning Todd's cognitive abilities.&lt;/p&gt;

&lt;p&gt;Ilya (1:33 PM): "Meanwhile your family goes without pay. I hope you can explain to them why... I hope your common sense prevails in spite of the mental issues that you are fighting with."&lt;br&gt;
Vince (5:49 PM): "You reap what you sow... I work every day... you who have put very little money in, turn your nose up to [opportunities]... I am thinking about calling a vote to remove you."&lt;br&gt;
Source: [2023-07-31] "Re: Email to Xin,"&lt;br&gt;
Legal Weight: Demonstrates a same-day "tag-team" approach to pressure a Member through financial threats and attacks on mental health.&lt;/p&gt;

&lt;p&gt;"I would understand your position if you invested money or brought in investors money but you have not. So your main complaint is you do not have control over my family's money and Ilya's money before that. Money that I have been paying you with so you can bash me..."&lt;br&gt;
Source: Vince Lindow [2022-09-23] "Fwd: è½¬å‘:Re: 3DGM and Z2D co-operation"&lt;br&gt;
Why it matters: Vince explicitly devalues Todd's 10+ years of solo engineering as having no "investment" value compared to the $30K-$50K Vince's relatives put in. He uses this to deny Todd's Member right to financial inspection.&lt;/p&gt;

&lt;p&gt;"I work every day at this company... you who have put very little money in, turn your nose up to [revenue opportunities]."&lt;br&gt;
Source: Vince Lindow [2023-07-31] "Re: Email to Xin,"&lt;br&gt;
Context: Vince demeaning Todd's professional decision to decline a project by framing it as a lack of "skin in the game."&lt;/p&gt;

&lt;p&gt;See More abusive direct quotes below and admissions of LLC rights violations: Read the Quotes&lt;/p&gt;
&lt;h2&gt;
  
  
  Friends
&lt;/h2&gt;

&lt;p&gt;Vince WAS a friend of mine before we approached Ilya Sorokin about 3DGameMarket (Ilya's forced rebranding of SpawnIt3D). At one point my business partner Vince told me we owed Ilya, our other partner, $1,000,000... I got angry and told Vince I DID NOT OWE ILYA ANY OF THAT, as I had NEVER been allowed to see the books, never allowed to have ANY say in what money was spent on, and that paying Ilya back WAS NOT a part of the original agreement. If someone owed Ilya $1,000,000, IT WAS NOT ME.&lt;/p&gt;

&lt;p&gt;Hell, I had to ask Ilya and Vince to buy anything I felt we needed, even after we were making money. Vince told me he would take care of it and I never heard about the supposed $1,000,000 again (because it never existed).&lt;/p&gt;

&lt;p&gt;Ilya and Vince would agree I completed software contracts completely on my own in the name of 3DGameMarket for companies like Deepub, Exceptional 3D, KDX, Z2D Vision, Acer, and more... and Ilya and Vince collected the money.&lt;/p&gt;

&lt;p&gt;I taught myself CSS, HTML, JavaScript, HLSL, GLSL, shader assembly language, C++, C#, SQL, DirectX (9, 10, 11, 12), OpenGL, WebGL, ASP.Net, Drupal, PHP, PayPal APIs, Ubercart, Alipay APIs, and more to better my abilities.&lt;/p&gt;

&lt;p&gt;Eventually Vince admitted 3DGameMarket had NEVER kept any books... and that is why he and Ilya could not share them with me. So Vince started watching YouTube videos about how to handle finances for a business and he began writing up books based on whatever he could find. So fake books were being created to try and make good on the promise Vince and Ilya made to actually do things legally... but it was just for show, and just for me. Those "books" were never meant to be REAL business financial records.&lt;/p&gt;

&lt;p&gt;I eventually told them both I would no longer create new products for 3DGameMarket LLC if I was not going to be treated like a partner, but I kept working on 3DGM as I believed in it and my own abilities.&lt;/p&gt;

&lt;p&gt;Of course 3DGM was not good enough for Vince and Ilya. They wanted to continue selling MY SKILLS like they had done in the past to Deepub, KDX, etc. They wanted more profits from jobs where I do 100% of the work and I alone am 100% responsible for the deliverables, but where THEY COLLECT ALL THE MONEY and share with me what THEY CHOOSE.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Z2D Deal
&lt;/h2&gt;

&lt;p&gt;Z2D wanted me to write a piece of software for them, and due to the ongoing issue with my partners and violations of my rights as a legal partner of an LLC, I declined. Vince and Ilya flipped their shit and came at me with a vengeance.&lt;/p&gt;

&lt;p&gt;I just kept working on 3DGM, which at this point I had improved immensely by creating a new way of generating additional 3D views in games by actually redrawing each frame from a different camera position - and it was BEAUTIFUL. Previously, 3DGM had been using code I wrote to extract the depth map from a frame and used that with the 2D color image to create additional views. The 2DZ (2D with depth) method worked well, but the 3D was a bit cardboard cutout... not with MRM. MRM, a shorthand name I gave it, meant "multiview render mode". My code would modify vertex shaders on the fly at runtime to allow for a second draw pass that would draw the second eye's view for significantly better 3D.&lt;/p&gt;

&lt;p&gt;But selling stuff on 3DGameMarket.net didn't appear to be what Vince and Ilya wanted. They never advertised. In fact, I personally paid for advertising out of the few dollars an hour I was making just to try and drive up business, as it was obvious my partners had ZERO intention of actually selling anything on our site. Vince and Ilya were more interested in making deals with other companies that involved my doing more contract jobs that THEY would collect on.&lt;/p&gt;

&lt;p&gt;Vince and Ilya were still pushing for me to do the software job for Z2D, and I had even researched the possibility, but what Z2D wanted was a bit far fetched. After telling Vince that, he came back at me and said Z2D was offering $100,000 now for the job, and that Ilya and Vince would give me $10,000 of that if I did the job. Mind you - at this time I owned 30% of 3DGameMarket and my PARTNERS were offering me the equivalent of a finder's fee to be 100% responsible for a complicated job I was not sure I could complete to Z2D's satisfaction... and I still did not have access to any 3DGameMarket financial records. So again, I declined.&lt;/p&gt;

&lt;p&gt;Vince and Ilya BLEW UP. Insults and threats started flying left and right in my direction from my "partners". The same partners who NEVER allowed me access to company financial records I had/have a legal right to immediately stopped paying and contributing. For nearly 2 years after that, I funded 3DGameMarket's servers myself out of my own pocket. I paid domain registration fees, hosting fees, etc., while maintaining and continuing to work on 3DGM software.&lt;/p&gt;
&lt;h2&gt;
  
  
  Trying to exit
&lt;/h2&gt;

&lt;p&gt;This does not even touch on the investors Vince got, who paid HIM $10,000 per 1% of 3DGameMarket. He never documented those investments, but frequently talked about them in his emails. He often referred to the investor money as "his family's money" and he treated it exactly like that. The money sat in an account labeled 3DGameMarket LLC, but ONLY HE was allowed to access that account and the records for that account. According to him, he was only doing the same thing Ilya had initially done: treat 3DGameMarket financials as personal accounts instead of belonging to the company.&lt;/p&gt;

&lt;p&gt;I eventually tried to sell my entire stake in 3DGameMarket to my partners, and Ilya bought most of it but REFUSED to buy it all - even though I offered to sell it ALL for $10,000 because my dog was dying and we needed a vet badly. Ilya paid me the $10,000 and made me keep 10% ownership of 3DGameMarket... likely because he knew the company was dead without me. I told him (and I quote from the email): "Honestly, I would rather sell it all and become an employee as I am tired of trying to get treated like a partner instead of a form of cheap labor who is otherwise ignored. ... If required, I agree."&lt;/p&gt;
&lt;h2&gt;
  
  
  Vince as CEO
&lt;/h2&gt;

&lt;p&gt;So Ilya has essentially exited 3DGameMarket at this point. He owns more than half the company but does absolutely nothing for it. I later found out he had filed a brand new Florida LLC without my knowledge or consent, listing only himself, and abandoned the original Delaware entity. He left Vince and me off the new filing completely. Eventually he added us back.&lt;/p&gt;

&lt;p&gt;Vince declares himself CEO and I couldn't care less, as I know it means nothing. Vince eventually starts paying me $200 a week to offset my own consistent investment in 3DGameMarket. The problem with that is the same problem it has always been: Vince thinks he is my boss because of that $200. He starts asking for phone calls so he can probe me for information... at which point I need to briefly address the "phone call issue".&lt;/p&gt;
&lt;h2&gt;
  
  
  Phone calls and lies
&lt;/h2&gt;

&lt;p&gt;After Vince LIED to me about owing Ilya $1,000,000 - while at my house, in a verbal conversation - I had BANNED Vince from my house and from communicating with me in any way except email. I flat out told him it was because I was sick of his lies and his stories always changing, so I wanted emails ONLY so what he said would be documented. That worked for a while. But now that Vince was paying me out of his own pocket and I was TRYING to trust him, the phone calls started again at his repeated request.&lt;/p&gt;

&lt;p&gt;But this is the same guy who has lied on and off for years; who has bullied me and mentally abused me to get what he wants. So I record the phone calls. Vince spends a lot of the phone calls talking about useless crap, and often tries to bait me into attacking Ilya or other people. Maybe he wasn't baiting me - but it sure seemed that way (to me and others who have listened to the recordings) - though I am not sure what his goals were with that. I keep working on 3DGM but not at the level I had been. I have ZERO ability to trust Vince, especially with the way he appears to be playing me during phone calls. So I continue working on areas that would benefit 3DGameMarket and allow me to improve 3DGM and even make new products eventually. See my GitHub plenty of those libraries are massively useful to a company that specializes in 3D gaming: &lt;a href="https://github.com/LostBeard" rel="noopener noreferrer"&gt;github.com/LostBeard&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  The "severance"
&lt;/h2&gt;

&lt;p&gt;To end it all, Vince threw another temper tantrum when he did not get the call he wanted, when he wanted, and when I had the gall to question the future of 3DGM specifically in today's market - given that advertising had NEVER entered his or Ilya's minds. Even though I proposed using my advanced SpawnDev libraries as the base for new products, Vince was frothing mad that I dared question him - the guy who had been working 50 hours a week to get me $200 a week.&lt;/p&gt;

&lt;p&gt;So he sends me a PayPal payment from the 3DGameMarket LLC account that ONLY HE has access to (and that he had been paying me out of for a year plus) with the message &lt;strong&gt;"Severance check 1 of 4"&lt;/strong&gt;. He was, once again, treating me as an employee - the same way he and Ilya always saw me and treated me. Like an employee, not a partner.&lt;/p&gt;

&lt;p&gt;After a little research, I found out 3DGameMarket had been dissolved by the state of Florida on Sept. 26, 2025 - 6 months earlier. Vince claims he knew nothing about it and that it is all Ilya's fault, and that we should start our own company without him to sell 3DGM. I ignore all of this. At this point, I am happy to be done with these two clowns.&lt;/p&gt;
&lt;h2&gt;
  
  
  The worst of 2 worlds: partner and employee
&lt;/h2&gt;

&lt;p&gt;They treated me like a partner to get cheap labor and to avoid employee labor laws. They treated me like an employee to avoid giving me the legal access to the books a partner has the legal right to.&lt;/p&gt;

&lt;p&gt;Vince Lindow Jr. and Ilya Sorokin are not good people and are worse business partners. 3DGameMarket was a scam to extract cheap labor from me - a somewhat intelligent programmer with severe social and general anxiety. Shame on them. I likely could sue, but I am choosing not to at this time because there is enough hostility in this world and I have a family and work to focus on. I wish them the best in their future endeavors. May they live long and prosper... and NEVER talk to me again. &lt;/p&gt;

&lt;p&gt;From one of the last emails from Vince: "You already got paid today and I will send you money for the next three weeks to give you time to get a job or get on disability". Sounds like he cares, right? No. The mention of disability is his way of poking me, as he knows I will not get on disability. Even the thought of applying for it causes me severe anxiety. FYI - he did NOT pay me again after that day like he said he would. Lying, manipulation, and abuse are what Vince does. He may not even realize he does it.&lt;/p&gt;

&lt;p&gt;I have left a LOT of things out for brevity. The evidence of abuse and improper conduct is staggering, but well documented in case it is ever needed.&lt;/p&gt;

&lt;p&gt;I received this message on LinkedIn from people I do not even know, warning me about Vince.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7dbxbh7fnv70xrl6c8b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7dbxbh7fnv70xrl6c8b.jpg" alt="Image of unsolicited warning about Vince" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the "severance" pay Vince sent me, which proves he treats me and thinks of me like an employee. Also, severance pay generally comes with an agreement not to sue. I never made any such agreement with anyone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfze728q3woqx4nof0zy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfze728q3woqx4nof0zy.jpg" alt="Image of severance pay notification: &amp;quot;Severance check 1 of 4&amp;quot;" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Be careful starting a business with other people. Even "friends" can turn into enemies when money is on the table.&lt;/p&gt;

&lt;p&gt;Be especially careful if you have a disability. Mine allowed two business "partners" to abuse me for 13 years. 🖖&lt;/p&gt;

&lt;p&gt;Signed,&lt;br&gt;
Todd Tanner&lt;/p&gt;
&lt;h2&gt;
  
  
  🛠️ Support Independent Open Source
&lt;/h2&gt;

&lt;p&gt;I’m a solo open-source developer building infrastructure for .NET in the browser that doesn’t exist anywhere else. 50+ MIT-licensed packages, 351,000+ total NuGet downloads, everything free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I build:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.BlazorJS" rel="noopener noreferrer"&gt;SpawnDev.BlazorJS&lt;/a&gt;&lt;/strong&gt; - 1,014 typed C# wrappers for the entire browser API (150K+ downloads)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.BlazorJS.WebWorkers" rel="noopener noreferrer"&gt;SpawnDev.BlazorJS.WebWorkers&lt;/a&gt;&lt;/strong&gt;: Run Blazor Wasm in WebWorkers, SharedWebWorkers, and ServiceWorkers. (95K+ downloads)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt;&lt;/strong&gt; - GPU compute on 6 backends (WebGPU, WebGL, Wasm, CUDA, OpenCL, CPU) from one codebase&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU.ML" rel="noopener noreferrer"&gt;SpawnDev.ILGPU.ML&lt;/a&gt;&lt;/strong&gt; - Native GPU neural network inference, no ONNX Runtime&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.WebTorrent" rel="noopener noreferrer"&gt;SpawnDev.WebTorrent&lt;/a&gt;&lt;/strong&gt; - Pure C# BitTorrent/WebTorrent, browser and desktop&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.RTC" rel="noopener noreferrer"&gt;SpawnDev.RTC&lt;/a&gt;&lt;/strong&gt; - Cross-platform WebRTC for .NET&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.MultiMedia" rel="noopener noreferrer"&gt;SpawnDev.MultiMedia&lt;/a&gt;&lt;/strong&gt; - Cross-platform camera, microphone, speakers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LostBeard/SpawnDev.Codecs" rel="noopener noreferrer"&gt;SpawnDev.Codecs&lt;/a&gt;&lt;/strong&gt; - Pure-.NET, ILGPU-accelerated, patent-clean audio and video codecs (Opus, VP8/9, AV1, FLAC, Vorbis)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your sponsorship goes directly to development time - no company, no overhead, just code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/sponsors/LostBeard" rel="noopener noreferrer"&gt;Become a Sponsor&lt;/a&gt;&lt;/strong&gt; - &lt;em&gt;Thank you for supporting independent open-source software!&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Donate with Crypto
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Currency&lt;/th&gt;
&lt;th&gt;Address&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bitcoin&lt;/td&gt;
&lt;td&gt;&lt;code&gt;bc1qw32ctpalcckxfpcxxhe6gym0pqwh4tlk2f3dlw&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ethereum&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x40D5D4C4fe0a2bcC2C0f72345Af327CA3620968b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Solana&lt;/td&gt;
&lt;td&gt;&lt;code&gt;239p6PjmHTi28sKbjiaHWvzUry5ZUmPZTtizUszEwVFZ&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Litecoin&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ltc1qxhawxpkp8wveu726hmj09ft94zhtu939det99h&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Crypto donations are anonymous by nature. If you'd like acknowledgment or want me to know who you are, send me an email at &lt;a href="mailto:lostit1278@gmail.com"&gt;lostit1278@gmail.com&lt;/a&gt; with your transaction details. Otherwise, just know that every donation is appreciated.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  SMOKING-GUN-QUOTES
&lt;/h2&gt;

&lt;p&gt;&lt;/p&gt;
  SMOKING-GUN-QUOTES.md
  &lt;h1&gt;
  
  
  3DGM - Smoking-Gun Verbatim Quotes (Counsel Cheat Sheet)
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;These quotes prove that 3DGM was a partnership when Vincent Lindow and Ilya Sorokin wanted to exploit Todd's labor and "owner-level" commitment, but was suddenly framed as an employment relationship in 2026 when they wanted to "fire" him without Member-level buyouts, all while violating Todd's legal rights as a partner the entire time. The abuse quotes (Items 18-19) prove that this "partnership" was maintained through economic duress, coordinated bullying, and exploitation of a known disability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Compiled:&lt;/strong&gt; 2026-04-17 PM&lt;br&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Single-page catalog of the verbatim quotes that do the most legal work. All drawn from the master union corpus (&lt;code&gt;_master-all-sources.jsonl&lt;/code&gt;) across all 4 Takeouts + Thunderbird.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Vince's "secret deal / oral agreements" admission — 2022-08-23
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr. (&lt;a href="mailto:vlindowjr@gmail.com"&gt;vlindowjr@gmail.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner (&lt;a href="mailto:lostit1278@gmail.com"&gt;lostit1278@gmail.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Paypal Debit Card&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Oh and here are the details of that secret deal that I made with the investors. LOL. &lt;strong&gt;one percent of royalties and equity for $10,000 dollars. These were all oral agreements which are legal in New York&lt;/strong&gt; and I told you about them."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Vince characterizes the deal as "secret," fixes the rate at $10K per 1% of royalties AND equity, admits the agreements are oral, and raises a NY-law defense that doesn't cure the FL Ch. 605 / operating-agreement / related-party problems.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Vince's "my family's money" refusal of Member inspection — 2022-08-23 (same thread)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"As a partner you are entitled to an equal share of all of our revenues that we make minus expenses. &lt;strong&gt;You are not entitled to access to my family's money.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vince calls Todd a &lt;strong&gt;"partner"&lt;/strong&gt; (not employee) in his own writing.&lt;/li&gt;
&lt;li&gt;Vince admits partners are entitled to equal share of revenues minus expenses.&lt;/li&gt;
&lt;li&gt;Vince then refuses Member inspection of the investor capital by calling it "my family's money" — the exact language courts cite as a refusal of statutory LLC Member rights under FL 605.0410.&lt;/li&gt;
&lt;li&gt;The "family" reference confirms the Lindow-family-investor relationship.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  3. Vince's "pay investors out of my shares" commingling admission — 2022-09-23
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr. (&lt;a href="mailto:vince@3dgamemarket.com"&gt;vince@3dgamemarket.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: 转发:Re: 3DGM and Z2D co-operation&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I have responded on Gmail. &lt;strong&gt;Fine I will pay the investors out of my shares.&lt;/strong&gt; Problem solved that was easy. One less thing for you to worry about."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Vince, as Manager, is casually moving investor liabilities off the LLC books and onto his personal equity — a textbook commingling / no-segregated-bookkeeping admission. "Problem solved that was easy" frames LLC governance as a casual personal matter, not a statutory duty.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Vince naming his mother and sister Lisa as investors — 2022-04-12
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Business Call&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Since yesterday I have gotten two investors. $10,000 available right after the Acer partnership is formalized with an advancement for me to go to Pax East and the other investor will be cutting us a check for 10,000 in the middle of May. &lt;strong&gt;My mom and Sister Lisa and they are both in 100%.&lt;/strong&gt; I am meeting Peter soon and he will also be in. Only two spots left."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Names two family-adjacent investors at $10K/1% (Vince's own mother and sister Lisa). Establishes related-party transactions the 10% Member was never shown documentation for.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Vince confirming investor #3 (Peter Parts) — 2022-04-16
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Call&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Sounds great. &lt;strong&gt;Just closed our third investor. Peter is in.&lt;/strong&gt; Two more to go."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Names Peter Parts (Ithaca / R.I.T. business incubator associate) as investor #3. Peter Parts is known to have been in direct email correspondence with Todd and in active dealings with 3DGM — corroborating subpoena target if needed.&lt;/p&gt;


&lt;h2&gt;
  
  
  6. Vince confirming investor #4 — 2022-04-26
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; The show went great&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;I got a 4th investor, one more to go.&lt;/strong&gt; And I am already on that."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Confirms 4 of 5 targeted investor slots closed by late April 2022. Investor #4's identity not disclosed in this corpus.&lt;/p&gt;


&lt;h2&gt;
  
  
  7. Potential investor #4 / #5 candidate — 2023-08-03
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Can we please fix this between us&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I really want to make us big money and I am so close. I would have sold a display today and &lt;strong&gt;got another investor&lt;/strong&gt; but we are fighting and we should not be. &lt;strong&gt;This investor is a classmate of mine and his son in law owns a large security company in Texas.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; First identifying detail on another investor candidate — a classmate of Vince's from his school years whose son-in-law owns a large Texas-based security company. This is enough detail for counsel to identify the individual through discovery if the investor's $10K payment ever appears in bank records.&lt;/p&gt;


&lt;h2&gt;
  
  
  8. Vince referring to "our 3DGM investors" in present tense — 2026-04-14 (3 days before "severance" memo)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr.&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Distributed computing... by TJ&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"All of this time, I could have been learning this stuff and maybe not even doing gaming if we had a plan for our &lt;strong&gt;3DGM investors&lt;/strong&gt;."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Three days before the "severance" memo, Vince writes casually of "our 3DGM investors" in present tense. The investors are still an active relationship. The LLC is still operating (despite being administratively dissolved). Vince is still the person managing the investor relationship. This is evidence that the April 17 action was retaliation against Todd, not a genuine wind-down.&lt;/p&gt;


&lt;h2&gt;
  
  
  9. Todd's written "I AM NOT YOUR EMPLOYEE" — 2022-09 era
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Todd Tanner&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Vince Lindow Jr.&lt;br&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Documented in &lt;code&gt;2026-04-17-severance-check-analysis.md&lt;/code&gt; line 98, in the context summary.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I AM NOT YOUR EMPLOYEE."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Todd's own written assertion, in caps, four years before the 2026 "severance" characterization. Establishes that Todd rejected employment framing contemporaneously — not retroactively for litigation.&lt;/p&gt;


&lt;h2&gt;
  
  
  10. Todd's "treat me like a partner / not a partner" assertions — 2022-09-23
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Todd Tanner (&lt;a href="mailto:lostit1278@gmail.com"&gt;lostit1278@gmail.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Stopped to see you&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"...partner in this company for the first time in 10 years, then we can talk strategy. &lt;strong&gt;If you wish to keep running the company like I am not a partner, you are welcome to make me an offer to buy me out.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Todd offering a buyout as the remedy for not being treated as a partner — the opposite of what an employee would write. Employees don't get "bought out." Partners / Members do.&lt;/p&gt;


&lt;h2&gt;
  
  
  11. Vince's documented abuse, devaluation, and financial manipulation (2013-2023)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Caution&lt;/p&gt;
&lt;p&gt;
Vince uses a cycle of "lashing out" followed by "we're family" apologies, while consistently devaluing Todd's technical labor relative to Vince's family's cash investments.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  A. Devaluation of Tech Labor vs. Cash ("My Family's Money")
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I would understand your position if you invested money or brought in investors money but you have not. So your main complaint is you do not have control over my family's money and Ilya's money before that. Money that I have been paying you with so you can bash me..."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2022-09-23] "Fwd: 转发:Re: 3DGM and Z2D co-operation"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; Vince explicitly devalues Todd's 10+ years of solo engineering as having no "investment" value compared to the $30K-$50K Vince's relatives put in. He uses this to deny Todd's Member right to financial inspection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I work every day at this company... you who have put very little money in, turn your nose up to [revenue opportunities]."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-07-31] "Re: Email to Xin,"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Vince demeaning Todd's professional decision to decline a project by framing it as a lack of "skin in the game."&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  B. Admissions of Outbursts ("Lashing Out")
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I am sorry for the way I handled the Z to D situation but that crushed me and I lashed out and I am sorry for that."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-11-03] "Re: Update"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Weight:&lt;/strong&gt; A formal, written admission by the Manager that his behavior during the August 2023 rupture was "lashing out." This corroborates the toxic environment claim.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I am starting to look stupid when I can't answer [Ilya's] questions... I am afraid if something is not done by then of what he will do."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2013-06-21] "Crepes and Ilya"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; An early example of Vince using Ilya as a "boogeyman" to psychologically pressure Todd into overworking.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  C. Financial Leverage and "Retirement" Carrots
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I am willing to talk about increasing your pay some if things are tough but I am done being ignored. ... As long as you are paid with our money every two weeks things are good."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2022-09-30] "If you do not want to do a meeting we can do a call."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Using the payment stream as a leash to force immediate communication/compliance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"In my opinion this is your best shot to make a lot of money for your family and we as friends could say we built this together and then sell it and retire."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2022-09-30] "If you do not want to do a meeting we can do a call."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; Dangling the "retirement" carrot to keep Todd's 100% solo labor locked into the 3DGM structure without formal pay or royalties.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  12. Structural fact: The post-dissolution continuation signal — 2025-09-26
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Fact (not quote):&lt;/strong&gt; The FIRST post-dissolution $200 weekly payment from "3D Game Market LLC" went out on &lt;strong&gt;2025-09-26&lt;/strong&gt; — the exact day Florida administratively dissolved the LLC. 28+ weekly $200 payments continued thereafter through 2026-04-17, all from the LLC PayPal account, with no written notice of dissolution to Todd as a Member.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; This is structural. A dissolved LLC continuing to disburse funds from its own PayPal account for 28+ weeks, while one Member is kept in the dark about the dissolution, is the textbook piercing-the-veil / failure-of-formalities fact pattern.&lt;/p&gt;


&lt;h2&gt;
  
  
  13. The 67-week payment stream — Jan 2025 to Apr 2026
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Fact (not quote):&lt;/strong&gt; 67 consecutive weekly $200 payments from Jan 2025 through Apr 17 2026. 66 of 67 were sent from the "3D Game Market LLC" PayPal account. Only one (2025-11-14) was from "Vincent Lindow Jr" personally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Vince's repeated written framing that the money was coming "out of my check / out of my paycheck" is contradicted by 98.5% of the actual payment instruments. The LLC is the payer. Vince's rhetoric is not the financial record.&lt;/p&gt;


&lt;h2&gt;
  
  
  14. The dual-PayPal-account structural fact — disclosed 2026-04-17 PM
&lt;/h2&gt;

&lt;p&gt;Per TJ direct testimony: two separate "3D Game Market"-named PayPal accounts exist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"3DGameMarket"&lt;/strong&gt; — Ilya Sorokin controls; deposits to a bank account Ilya controls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"3DGameMarket LLC"&lt;/strong&gt; — Vince Lindow Jr. controls; deposits to a bank account Vince controls.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Todd's historical access (clarified 2026-04-17 PM):&lt;/strong&gt; Todd had operational access to the PayPal accounts when he set up the Drupal/Ubercart storefront on 3dgamemarket.com — that access was required because Vince and Ilya could not configure the storefront themselves. However, &lt;strong&gt;the PayPal accounts were only ever used for retail site transactions&lt;/strong&gt; — customer purchases of displays, games, subscriptions. &lt;strong&gt;Todd has seen the destination bank account numbers in the PayPal deposit-configuration settings&lt;/strong&gt; (those numbers are visible to any PayPal admin, because PayPal has to know where to sweep collected funds), &lt;strong&gt;but Todd has never been allowed to view the destination bank accounts directly&lt;/strong&gt; — no statements, no transaction histories, no balances, no non-PayPal deposits. The actual business money (investor $10K contributions, wholesale / Dimenco / Acer / KDX / Philips / psHolix deals, licensing revenue) never flowed through PayPal; those went straight into the manager-controlled private bank accounts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Two parallel manager-controlled financial rails with no Member oversight of the destination bank accounts is textbook commingling and a predicate fact for piercing-the-veil analysis. Even more importantly: Todd &lt;strong&gt;knows the destination bank account numbers&lt;/strong&gt; (he saw them in the PayPal settings) but was &lt;strong&gt;denied inspection&lt;/strong&gt; of the accounts those identifiers point to. That is a perfected, specific denial of the FL Ch. 605.0410 Member inspection right — not a speculative one. Counsel can make a targeted inspection demand by account number, not just by category.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentary backup:&lt;/strong&gt; 2017-09-29 screenshots preserved at &lt;code&gt;D:/3DGM Legal/2017-09-29 PayPal Screenshots/&lt;/code&gt; and documented in &lt;code&gt;D:/3DGM Legal/_research/docs/EVIDENCE-PayPal-Screenshots-2017.md&lt;/code&gt;. The screenshots show the Ilya-controlled PayPal Merchant ID &lt;strong&gt;XMUJ4UQ48EPZY&lt;/strong&gt; and primary destination bank account &lt;strong&gt;TD Bank NA x-4837&lt;/strong&gt;, along with Todd's authorized sub-user login &lt;strong&gt;ToddT3DGM&lt;/strong&gt; — proving both the existence of the dual-rail structure and Todd's formal (but limited to the PayPal surface) access.&lt;/p&gt;


&lt;h2&gt;
  
  
  15. Ilya's own writing on Dec 26/27 2023 — treating the transaction as a Member share sale, not employment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin (&lt;a href="mailto:sorokin.ilya@gmail.com"&gt;sorokin.ilya@gmail.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: My dog is sick&lt;br&gt;
&lt;strong&gt;Dates:&lt;/strong&gt; 2023-12-26 → 2023-12-27&lt;/p&gt;

&lt;p&gt;Ilya's numbered proposal to Todd (quoted back in the reply):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"1. I would like you to be a part of the company, &lt;strong&gt;so I will buy 23% for $10k, you will keep 10%&lt;/strong&gt;."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ilya's follow-up after Todd provisionally accepts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Thanks for your answer. &lt;strong&gt;I definitely want you to be the part of the team. You worked too hard to just walk away from it all.&lt;/strong&gt; I need your address in order to complete the wire."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And Todd's reply in the same thread:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Honestly, I would rather sell it all and become an employee as I am tired of trying to get treated like a partner instead of a form of cheap labor who is otherwise ignored. ... If required, I agree."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then Ilya wires the $10K to Todd's personal address (8377 Main St Apt 1, Interlaken NY).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; This is Ilya — the registered Manager (MGR) on the LLC's Florida filings, and the Member who became the largest single equity holder after the December 2023 purchase (approximately 56% post-purchase: roughly 33% founding interest plus the 23% he bought from Todd). He is characterizing the December 2023 transaction IN HIS OWN WRITING as (a) a purchase of 23% of Todd's equity, (b) leaving Todd as a 10% Member of the company going forward, and (c) explicitly REJECTING Todd's offer to "sell it all and become an employee." Ilya chose Member-retention over employee-conversion. That choice forecloses any 2026 characterization of Todd as an employee terminable "for cause" via PayPal memo. Vince retains approximately 30-33% of his own — or whatever is left after his undisclosed 1%-per-$10K investor sales, which have never been documented to the 10% Member.&lt;/p&gt;


&lt;h2&gt;
  
  
  16. Ilya's 2023-07-31 three-way partnership description + confirmation Vince borrowed from relatives
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Email to Xin,&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-07-31&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"In our relationship, it was always clear that &lt;strong&gt;I was providing funding, Vince was dealing with operational responsibilities and you deal with tech.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And in the same email:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;He borrowed money from his closest relatives so that he could pay you&lt;/strong&gt;, he even increased your pay using this money."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Three-way role division in Ilya's own words.&lt;/strong&gt; Ilya = funding; Vince = operations; Todd = tech. This is an owner/partner structure, not an employer-employee hierarchy. No employer describes their relationship to an employee as "you deal with tech" equivalent with "I was providing funding" and "Vince was dealing with operational responsibilities."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Independent second-source corroboration of the secret-deal narrative.&lt;/strong&gt; Ilya admits on the record that Vince borrowed from "closest relatives" to pay Todd. This aligns exactly with Vince's own 2022-04-12 admission that his mom and sister Lisa were investors at $10K each. Ilya knew about it. The $30K+ that flowed into 3DGM from the Lindow family is corroborated from two independent Manager-level sources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Increased your pay using this money."&lt;/strong&gt; Ilya is stating that the Lindow-family investor capital was used to fund payments to Todd — i.e. that the investor funds were commingled with Member distributions via Vince's PayPal rail, not segregated on LLC books.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  17. Ilya's 2023-08-07 "OUR business / your business as much as it is ours"
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; This is urgent&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-08-07&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I want to talk about &lt;strong&gt;OUR business&lt;/strong&gt;. ... I hope you make a smart decision — &lt;strong&gt;it is your business as much as it is ours.&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;"&lt;strong&gt;For years we let you do whatever you wanted, at your own pace and unknown deliverables.&lt;/strong&gt; You can thank Vince for that, by the way, he was your biggest supporter."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Ilya is describing an owner-level relationship — Todd's autonomy over his own pace and deliverables, the company described as "your business as much as it is ours," peer partnership phrasing throughout. This is not how any employer describes an employment relationship. Ilya's own words here, four months before he bought 23% from Todd, are directly inconsistent with the 2026 "severance" framing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direct rebuttal to "unknown deliverables":&lt;/strong&gt; The deliverables were not unknown. See &lt;code&gt;EVIDENCE-Todd-Deliverables-Projects-Inventory.md&lt;/code&gt; in this same folder, which catalogs 40+ distinct Visual Studio solutions authored solo by Todd for 3DGM (2014-2026), a public GMRender API SDK with worked DX9/DX11 example renderers distributed to third-party integrators, custom Drupal modules powering 3dgamemarket.net, and the open-source Rendusa 2D+Z media viewer served live at &lt;code&gt;3dgamemarket.net/rendusa/&lt;/code&gt; and published at &lt;code&gt;github.com/LostBeard/rendusa&lt;/code&gt;. Every page of the company's own public website carries the footer "3DGameMarket by Todd Tanner" — Ilya cannot credibly claim not to know what Todd was building while Ilya's company was publicly attributing authorship to him.&lt;/p&gt;


&lt;h2&gt;
  
  
  18. Ilya's documented abuse, financial threats, and psychological manipulation (2015-2023)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Caution&lt;/p&gt;
&lt;p&gt;
Ilya consistently weaponized Todd's family's survival (rent/food) and his disability (anxiety) to enforce compliance, while explicitly denying employment status to avoid liabilities.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  A. Coercion via Financial Survival (Rent/Food/Family)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"Meanwhile your family goes without pay. I hope you can explain to them why."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-07-31] "Re: Email to Xin,"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Retaliation for Todd declining Z2D work. Direct coercion using Todd's family's well-being.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Weight:&lt;/strong&gt; Establishes a pattern of "economic duress" and predatory management.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"If I hold back, you will not have enough money to pay rent or to buy food, what I promised in order for us to have a payday as a team."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2017-01-06] "Re: Copyright"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Explicitly linking payment (survival) to "partnership" compliance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"This is what will put food on your family table! If you do not do it, we are done!"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-04-06] "Wake up call"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Demanding participation in a late-night conference call despite Todd's documented anxiety.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  B. Attacks on Disability (Anxiety/Mental Health)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"I hope your common sense prevails in spite of the mental issues that you are fighting with."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-07-31] "Re: Email to Xin,"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Weaponizing Todd's anxiety/disability to dismiss his professional refusal of work.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"You asked me not to call you because you 'freeze' when I call. But I do not hear from you. ... I will pay today, but I need you to send me weekly update..."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2016-01-18] "Re: Work"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Ilya acknowledges Todd's "freeze" response (disability) but immediately leverages payment to force a communication style that triggers it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"It would be a lot easier if you just email your questions. It also would give me a chance to think about your questions as I get anxiety on the phone and it makes me babble."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2015-10-10] Todd to Ilya ("Re: Phone Call")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Proves Todd formally notified Ilya of his disability and requested an accommodation (asynchronous communication) as early as 2015.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"not even capable to talk to me after 12 years of knowing me."&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-08-07] "This is urgent"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  C. Explicit Denial of Employment (Partnership Framing)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"You are not my slave, you are not my servant, you are definitely not my employee, etc. What you are - is my partner in 3D Game Market."&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2017-01-06] "Re: Copyright" (Email &lt;code&gt;idx: 115&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; A definitive "smoking gun" where the Managing Member explicitly rejects the employer-employee relationship to enforce "partnership" duties. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Weight:&lt;/strong&gt; Establishes &lt;strong&gt;Equitable Estoppel&lt;/strong&gt;; Ilya cannot legally claim Todd was an employee in 2026 after explicitly disclaiming that status in 2017 to secure Todd's "partner-level" commitment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  19. The August 2023 Rupture: Coordinated abuse and "Teaming Up"
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Caution&lt;/p&gt;
&lt;p&gt;
In late July and early August 2023, after Todd declined a 3rd-party project (Z2D), Ilya and Vince launched a coordinated psychological and financial assault to force compliance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  A. Coordinated Berating (July 31, 2023)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ilya (1:33 PM):&lt;/strong&gt; &lt;em&gt;"Meanwhile your family goes without pay. I hope you can explain to them why... I hope your common sense prevails in spite of the mental issues that you are fighting with."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vince (5:49 PM):&lt;/strong&gt; &lt;em&gt;"You reap what you sow... I work every day... you who have put very little money in, turn your nose up to [opportunities]... I am thinking about calling a vote to remove you."&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-07-31] "Re: Email to Xin,"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Weight:&lt;/strong&gt; Demonstrates a same-day "tag-team" approach to pressure a Member through financial threats and attacks on mental health.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  B. "Friendship" Retraction and Devaluation (August 2, 2023)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;"I considered you a friend and do not any more. We are business partners and that is it. I will no longer defend your ridiculous actions... Your days of holding this company hostage are over."&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"You are great at programing and sadly because of this you think you are some sort of genius. Well in programing maybe but that is where it ends."&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-08-02] "3DGM user TUFEIXP needs his account extended..."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Vince explicitly moving the relationship from "friendship" to "adversarial partner" while demeaning Todd's cognitive abilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  C. Admission of Partnership While Threatening Legal Action (August 6, 2023)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"You are listed as a partner of 3D Game Market and it will be up to the court to decide that matter if it comes to that."&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; [2023-08-06] "Re: Debts"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; Vince explicitly acknowledges Todd's status as a "listed partner" while simultaneously using the threat of litigation to coerce labor for the Z2D project.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  20. The "Safe Battery" (Oct 2017) - Ilya's Exclusive Control
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow (&lt;a href="mailto:vlindowjr@gmail.com"&gt;vlindowjr@gmail.com&lt;/a&gt;)&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2017-10-18&lt;br&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Todd is asking for a code-signing certificate to continue work. Vince explains why the paperwork is unavailable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Ilya locked all of our paperwork up in his safe and the battery died. He has to go through a lot of hoops with the company of the safe to get it open. So he is getting duplicates sent out to him from Delaware. ... We need that paperwork for not only the code signing certificate but also Ali pay."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exclusive Control:&lt;/strong&gt; Documented admission that the Managing Member (Ilya) maintained exclusive physical control over corporate records (Delaware formation docs, etc.) in a private safe.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access Refusal (Proximate):&lt;/strong&gt; The "dead battery" excuse serves as a contemporaneous documentation of TJ's inability to access corporate records, supporting the 2023-2026 "books and records" refusal claims.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jurisdictional Proof:&lt;/strong&gt; Confirms the company was still "Delaware" in 2017, predating the fraudulent Florida move.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  21. The "German Team" Pitch (Oct 2025) - Sole Programmer &amp;amp; Dormancy Admissions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Audio Excerpt &lt;code&gt;2025-10-21-vince-reads-german-team-pitch-five-years-stopped.md&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2025-10-21&lt;br&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Vince reads aloud a written pitch he sent to a German prospective partner (3D Global / Stan).&lt;/p&gt;
&lt;h3&gt;
  
  
  Admission: Sole Technical Contributor
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Vince: "&lt;strong&gt;Because as we all know, we only have one programmer, and that's you.&lt;/strong&gt;" [00:17:16]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Admission: Five-Year Development Stop (Dormancy)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Vince: "&lt;strong&gt;As far as the artifacts go, I agree with everything they are saying and that is why we quit working on this code over five years ago.&lt;/strong&gt;" [00:10:28]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Admission: IP Negligence (Patent unfiled)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Vince: "We have a patent written for this, but not filed." [00:13:37]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Misclassification:&lt;/strong&gt; Vince admits on tape that 100% of the LLC's technical work is performed by Todd.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Governance Fraud:&lt;/strong&gt; Admits the LLC (controlled by Ilya/Vince) has been technically "dormant" since 2020, despite Ilya soliciting investment/buy-ins (like the 2023 TJ equity buy-back) under the premise of an active development company.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Leverage:&lt;/strong&gt; The unfiled patent is not just "negligence"; it is a documented &lt;strong&gt;defensive action&lt;/strong&gt; by Todd. He explicitly informed the partners that he would not sign over his software ideas to the LLC until they cured their breach of his statutory right to inspect the company's books. (See Section 23 for verbatim quote).&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  22. The "Army Simulator" &amp;amp; "Mako" (Oct 2022) - Customer Identifiers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Audio Excerpt &lt;code&gt;2022-10-04-vince-partner-in-florida-and-payroll-stall.md&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2022-10-04&lt;br&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Vince discussing customer pipeline and past failures.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Vince: "&lt;strong&gt;America's best working&lt;/strong&gt;" / "&lt;strong&gt;The Army simulator&lt;/strong&gt;" (identifying 3DGM customers/projects)&lt;br&gt;
Vince: "&lt;strong&gt;The Mako&lt;/strong&gt;" customer identity - took 3DGM free work and went to competitor.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deliverable Documentation:&lt;/strong&gt; Identifies specific third-party projects (Army simulator) that rebut any claim of "unknown deliverables."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exploitation:&lt;/strong&gt; Identifies "Mako" as a case where 3DGM (via Vince) gave away Todd's labor for free to a competitor.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  23. The "Patent-for-Books" Leverage (Aug 2023) - Strategic Refusal
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Email &lt;code&gt;archive-3&lt;/code&gt;, &lt;code&gt;idx: 836&lt;/code&gt; / "LLC Advice addendum"&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-08-02&lt;br&gt;
&lt;strong&gt;Context:&lt;/strong&gt; In a comprehensive memo outlining the partnership's breakdown, Todd documents his reasoning for refusing to cooperate on Intellectual Property filings.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;Vince and Ilya want to patent my methods and techniques but again I told them I refuse to consider it while they are refusing to give me access to our companies financial data. They of course again attack me for damaging the company.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intentional Defense:&lt;/strong&gt; Proves that the "unfiled patent" mentioned by Vince in 2025 was the direct result of Todd exercising his rights as a Member to protect his IP until the LLC complied with governance requirements (FL Ch. 605).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notice of Breach:&lt;/strong&gt; Confirms that the partners were put on notice that IP cooperation was contingent on legal compliance, which they refused, choosing instead to "attack" Todd for "damaging the company."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rebuttal to "Job Abandonment":&lt;/strong&gt; Reframes the refusal to "do the job" (Z2D/Patents) as a legitimate protective measure by an owner, not a failure of an employee.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  24. The "$1,000,000 Debt" Fraud Attempt (Circa 2020)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Email &lt;code&gt;archive-3&lt;/code&gt;, &lt;code&gt;idx: 836&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-08-02 (reporting 2020 event)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Vince has lied about how much we owe our other partner Ilya. &lt;strong&gt;He told me at 1 point that we owed Ilya around $1,000,000.00 (this was around 2020.)&lt;/strong&gt; I told Vince 'I did not owe him that' as I never had access to any money or even information about what money was being spent on. Vince eventually told me never mind. I can only assume because he knew I would want proof."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Financial Misrepresentation:&lt;/strong&gt; Documented attempt by the partners to fabricate or grossly inflate LLC debt to a Member (Ilya) to dilute Todd's interest or justify withholding payments. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pattern of Deceit:&lt;/strong&gt; Supports the claim that the financial records were obscured specifically to facilitate this type of accounting fraud.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  25. Admission of Work Effort (70+ Hour Weeks for Minimum Wage)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Email &lt;code&gt;archive-3&lt;/code&gt;, &lt;code&gt;idx: 836&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;I spent countless days frequently working 18 hours and easily 70+ hour weeks while getting nothing more than as much pay as a minimum wage employee would for 2 days.&lt;/strong&gt; I had hoped that when we started making more money it would even out."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Labor Exploitation:&lt;/strong&gt; Establishes the extreme disparity between the value provided (technical development of 2 separate 3D conversion methods) and the compensation received.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investment of Sweat Equity:&lt;/strong&gt; Bolsters the argument that Todd's interest in the company is rooted in massive uncompensated labor (quasi-partnership) rather than a simple at-will employment relationship.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  26. Admission of Project Valuation ($100,000 Z2D Value)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Email &lt;code&gt;archive-3&lt;/code&gt;, &lt;code&gt;idx: 836&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;The job I have refused to do is being valued at $100,000.00.&lt;/strong&gt; We would supposedly be paid partially in cash, product discounts from the 3rd party asking for the project which we would resell, and a % of all sales they make on the project."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Economic Value of TJ's Labor:&lt;/strong&gt; Admission that a single project Todd was asked to perform had a market value of $100,000, contradicting any claim that his work was "personal indulgence" or of negligible value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Damages Basis:&lt;/strong&gt; Provides a concrete baseline for calculating back-pay and lost equity value.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  27. The "My Shares" Admission (Sep 2022) - Equity Allocation Dispute
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; Email &lt;code&gt;archive-2&lt;/code&gt;, &lt;code&gt;idx: 815&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2022-09-23&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;Fine I will pay the investors out of my shares. Problem solved that was easy. One less thing for you to worry about.&lt;/strong&gt;" — Vince Lindow Jr.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Equity Affirmation:&lt;/strong&gt; Vince's admission confirms that Todd's ownership interest was NOT diluted by these investors, as Vince conceded the equity came solely from his own personal allocation after Todd challenged the lack of financial transparency.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  28. Vince ties "the books" to source-code access and admits "partners withhold things" — 2023-11-03
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Vincent Lindow Jr. (&lt;a href="mailto:vince@3dgamemarket.com"&gt;vince@3dgamemarket.com&lt;/a&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner (&lt;a href="mailto:lostit1278@gmail.com"&gt;lostit1278@gmail.com&lt;/a&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Subject:&lt;/strong&gt; Re: Update&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-11-03 (same thread as Todd's "broke LLC law by violating my legal right to see the books" reply)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt; Todd had been demanding Member-level financial transparency; Vince and Ilya had been pressuring Todd to deliver / characterize 3DGM source code. In this reply Vince explicitly juxtaposes books visibility with how often Todd "let" them see source code, then mirrors that as mutual "withholding" between partners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Longer paragraph (books justified by low revenue + source code seen only once):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"This was never intentionally held from you as before these, there are no books that I know of and any money we got from Deepub went back into the business. I never thought this was a bad thing with the books as we had no or little revenue and &lt;strong&gt;you have only let us see the source code once.&lt;/strong&gt; Thousands of dollars that was supposed to be paid by DeePub was not paid and I have copies of the emails requesting it and there responses. No money was ever withheld from you."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Admission (same message, immediately after QuickBooks / bank-access promises):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;I do understand your frustration with not seeing the books. I have seen the source code once. It does suck when partners withold things. I will not do it anymore.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(Original email spells &lt;strong&gt;withold&lt;/strong&gt;; preserved verbatim.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Todd's same-thread rebuttal (IP vs books — not a wage demand):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Todd Tanner&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2023-11-03 (reply same day)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;I told you and Ilya from the get go that the source code and IP is mine and that 3DGameMarket has an exclusive license to the product.&lt;/strong&gt; The fact you even saw the source code once is due to the extortion you and Ilya used to get it. &lt;strong&gt;You and Ilya however broke LLC law by violating my legal right to see the books for 10 years.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conditional / reciprocal framing in Vince's own words:&lt;/strong&gt; He links frustration over books to frequency of source-code visibility ("only let us see the source code once"), supporting Todd's narrative that access to records was &lt;strong&gt;bargained against&lt;/strong&gt; delivery of IP — not a clean employer "work for hire" pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partner-level characterization:&lt;/strong&gt; "It does suck when partners withold things" is Vince describing the relationship as &lt;strong&gt;between partners who withhold from each other&lt;/strong&gt;, inconsistent with a simple at-will employee who must surrender all code on demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Written concession:&lt;/strong&gt; Vince admits understanding Todd's complaint about not seeing books and labels the dynamic as withholding he "will not do it anymore" — useful for &lt;strong&gt;timeline and pattern&lt;/strong&gt; (books/access disputes) even if later conduct diverged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Todd's contemporaneous IP + statutory framing:&lt;/strong&gt; Exclusive-license model and "legal right to see the books" stated the same day counters any retroactive story that Todd was always treating company code as purely corporate property with no Member conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Documentary backup:&lt;/strong&gt; Full thread extraction, Message-IDs, and Gmail thread ID &lt;code&gt;1781472207089318487&lt;/code&gt; in &lt;code&gt;D:/3DGM Legal/2023-11-03-todd-to-vince-broke-llc-law-and-vince-admission.md&lt;/code&gt;. Cross-index: &lt;code&gt;EVIDENCE-Books-Refusal-Pattern-Master-Index.md&lt;/code&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  29. Supplemental Ilya-authored material (controlled tone — high legal signal)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; Ilya’s writing is usually less chaotic than Vince’s, but these passages are &lt;strong&gt;not&lt;/strong&gt; fully broken out elsewhere in this cheat sheet. They show &lt;strong&gt;(a)&lt;/strong&gt; IP / “company owns the product” pressure, &lt;strong&gt;(b)&lt;/strong&gt; personal dependence / “carrying you” framing, &lt;strong&gt;(c)&lt;/strong&gt; explicit &lt;strong&gt;owner-not-employee&lt;/strong&gt; + &lt;strong&gt;funder leverage&lt;/strong&gt;, &lt;strong&gt;(d)&lt;/strong&gt; &lt;strong&gt;funding cut-off&lt;/strong&gt; threats, and &lt;strong&gt;(e)&lt;/strong&gt; &lt;strong&gt;minimization of books requests&lt;/strong&gt; while acknowledging anxiety. Sources preserved in &lt;code&gt;_research/docs/_scan_ilya_abuse_CURATED.md&lt;/code&gt; and &lt;code&gt;_research/docs/_debug_ilya_threats_FULL.txt&lt;/code&gt; (grep &lt;code&gt;ethical values&lt;/code&gt;, &lt;code&gt;kiss your ass&lt;/code&gt;, &lt;code&gt;not funding 3DGM&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;
  
  
  A. [2017-03-15] Re: How to make 3DGM and KDX work together? — IP, reciprocity, dependence, NY verbal agreements, “ethical values”
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"…&lt;strong&gt;The product that we have developed belongs to the company not just to Todd Turner.&lt;/strong&gt; I have been &lt;strong&gt;funding your work for over 4 years in good faith, and definitely expect the same in return.&lt;/strong&gt; … &lt;strong&gt;Right now you might feel like the king of the mountain, but you would not get where you are now without me and Vince. If you do not see it, you are short sighted.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Just for your info, &lt;strong&gt;verbal agreements are legally binding in the state of New York, just in case my assessment of your ethical values is incorrect.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Controlled, lawyer-adjacent diction — but content is &lt;strong&gt;IP capture&lt;/strong&gt; (“belongs to the company not just to Todd Turner”), &lt;strong&gt;quid pro quo&lt;/strong&gt; on funding vs deliverables, &lt;strong&gt;economic dependence&lt;/strong&gt;, and an &lt;strong&gt;implied threat&lt;/strong&gt; (NY law + questioning “ethical values”). Pairs against Todd’s &lt;strong&gt;exclusive-license&lt;/strong&gt; and &lt;strong&gt;Member books&lt;/strong&gt; positions.&lt;/p&gt;
&lt;h3&gt;
  
  
  B. [2017-03-15] Same thread — numbered clarification (employment denial + “OUR business”)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;3. MOST IMPORTANT - you are not my employee, I am not paying your salary, I do not own 3DGamemarket. It is OUR business&lt;/strong&gt; which I am keeping afloat in hopes that all of us will make money from it."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Second &lt;strong&gt;2017&lt;/strong&gt; Ilya &lt;strong&gt;not-an-employee&lt;/strong&gt; statement (distinct thread from the Jan 6, 2017 “Re: Copyright” email already cited in Item 18). Reinforces &lt;strong&gt;equitable estoppel&lt;/strong&gt; pattern across multiple dates.&lt;/p&gt;
&lt;h3&gt;
  
  
  C. [2017-05-05] Re: Coding — “paying your bills,” “carrying you,” crude humiliation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"…I appreciate your work and efforts &lt;strong&gt;much more than you appreciate me paying your bills for the last 4 years.&lt;/strong&gt; Instead of thank you, I get a feeling that you feel that I owe you something. … &lt;strong&gt;if I thought of you as my employee we would not have these conversations.&lt;/strong&gt; … &lt;strong&gt;Does it men that I will kiss your ass - absolutely not! Nor would I expect to kiss mine because I have been carrying you for so long.&lt;/strong&gt; … &lt;strong&gt;your are kicking ass and we would not be here without you. You just have to realize that we would not be here without Vince&lt;/strong&gt; or me either!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; &lt;strong&gt;Patron / funder dominance&lt;/strong&gt; and &lt;strong&gt;degrading language&lt;/strong&gt; while still admitting &lt;strong&gt;partner&lt;/strong&gt; framing (“if I thought of you as my employee…”). Useful for &lt;strong&gt;hostile-environment / severity&lt;/strong&gt; and for rebutting any portrait of Ilya as a distant passive investor.&lt;/p&gt;
&lt;h3&gt;
  
  
  D. [2017-10-26] Re: Deepub Contract — “pizza” / owner status / “carrying you and Vince for 6 years”
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;Your argument about delivering pizza would be totally valid if you were an employee of the company, but you are not - you are the owner.&lt;/strong&gt; And &lt;strong&gt;the only reason you still have this status is because I have been carrying you and Vince for 6 years (like it or not).&lt;/strong&gt; You and Vince have been working very hard, but &lt;strong&gt;you did not do it for me or my company, you did and still doing it for yourself and your company.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Ilya &lt;strong&gt;in writing&lt;/strong&gt; calls Todd &lt;strong&gt;the owner&lt;/strong&gt;, admits &lt;strong&gt;years of financial carry&lt;/strong&gt;, and uses &lt;strong&gt;contemptuous analogy&lt;/strong&gt; (“delivering pizza”) to dismiss Todd’s grievance — inconsistent with a arms-length employer treating a minimum-wage worker, and inconsistent with later &lt;strong&gt;employee/severance&lt;/strong&gt; framing.&lt;/p&gt;
&lt;h3&gt;
  
  
  E. [2023-04-03] Re: Coffee — books minimization + anxiety + “hundreds of thousands”
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Thanks for the update. &lt;strong&gt;I understand your anxiety&lt;/strong&gt; and that is the reason we have not been communicating. … &lt;strong&gt;You keep on asking about financial reports - frankly I am not sure what you are hoping to find there&lt;/strong&gt;, every dollar (as little as we have) goes to pay you and Vince … &lt;strong&gt;I have been funding this company for years and years, hundreds of thousands of dollars without getting one penny in&lt;/strong&gt; …"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(Truncated in corpus; full body in &lt;code&gt;_scan_ilya_abuse_CURATED.md&lt;/code&gt; §2 and &lt;code&gt;emails-from-ilya.md&lt;/code&gt;.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; &lt;strong&gt;Acknowledges anxiety&lt;/strong&gt; then &lt;strong&gt;dismisses books&lt;/strong&gt; (“not sure what you are hoping to find”) — same period as escalating pressure. Supports &lt;strong&gt;pattern&lt;/strong&gt;: financial opacity + disability-aware management.&lt;/p&gt;
&lt;h3&gt;
  
  
  F. [2023-04-08] Re: Meeting Recap — funding ultimatum (Z2D pipeline)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin (mobile)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;Just want to put everyone on notice - if my emails are ignored I am not funding 3DGM any longer.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Plain &lt;strong&gt;economic coercion&lt;/strong&gt; in one sentence — &lt;strong&gt;three weeks before&lt;/strong&gt; the July–Aug 2023 Z2D rupture window. Shows Ilya’s &lt;strong&gt;controlled&lt;/strong&gt; voice still issuing &lt;strong&gt;all-or-nothing funding&lt;/strong&gt; threats.&lt;/p&gt;
&lt;h3&gt;
  
  
  G. [2017-08-03] Re: $300 left to pay on car — Ilya to &lt;strong&gt;Vince&lt;/strong&gt; (triangulation about Todd)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Vincent Lindow Jr. (not Todd)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"…&lt;strong&gt;It is almost like Todd saying that he is the only one working and we are having a free ride, even though both of us know he would not be anywhere without our support.&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Not sent to Todd, but &lt;strong&gt;admissibility&lt;/strong&gt; is for counsel; it shows &lt;strong&gt;how Ilya characterized Todd internally&lt;/strong&gt; during the same era as the “carrying you” emails — &lt;strong&gt;undercut / free ride&lt;/strong&gt; narrative while Ilya funded.&lt;/p&gt;


&lt;h2&gt;
  
  
  30. Second-pass Ilya — Jul/Aug 2023 completeness + Jan 2019 “falls on Todd” (attribution note)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; Another pass through &lt;code&gt;emails-from-ilya.md&lt;/code&gt; surfaced &lt;strong&gt;Ilya-only&lt;/strong&gt; lines that were easy to miss because the &lt;strong&gt;2023-07-31&lt;/strong&gt; message in the archive &lt;strong&gt;embeds a long quoted block from Vince&lt;/strong&gt; (profanity, “moron,” lawyer/police threats) &lt;strong&gt;below&lt;/strong&gt; Ilya’s own paragraphs. &lt;strong&gt;Do not attribute Vince’s quoted text to Ilya.&lt;/strong&gt; Ilya’s own paragraphs are still high-signal for &lt;strong&gt;control, pay conditioning, and character attacks.&lt;/strong&gt; This item also pulls &lt;strong&gt;Aug 7, 2023&lt;/strong&gt; lines not quoted in &lt;strong&gt;Item 17&lt;/strong&gt;, and the &lt;strong&gt;Jan 14, 2019&lt;/strong&gt; “friend and partner / all falls on Todd” block (cross-ref &lt;code&gt;EVIDENCE-2015-2024-Z2D-KDX-Biao-Decade-Long-Customer-Plus-Ilya-2019-Partner-Admission.md&lt;/code&gt; in &lt;code&gt;_research/docs/&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;
  
  
  A. [2023-07-31] &lt;code&gt;ilya@3dgamemarket.com&lt;/code&gt; — “Re: Email to Xin,” (Ilya’s own words to Vince, Todd &amp;amp; Parts Cc’d)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin (&lt;code&gt;ilya@3dgamemarket.com&lt;/code&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Vince — &lt;strong&gt;Cc:&lt;/strong&gt; Todd, Peter Parts  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;You are not running your own show and can not make the decisions that hurt the company (and you in the process by the way). If you are not working you are not getting paid&lt;/strong&gt;, I believe even you understand this."&lt;br&gt;&lt;br&gt;
… "&lt;strong&gt;But as far as business is conserved your actions are detrimental to it.&lt;/strong&gt;"&lt;br&gt;&lt;br&gt;
"&lt;strong&gt;In the past you came around after a few days past your ridiculous outbursts apologized to Vince and completed the work.&lt;/strong&gt; So I will hope for her same."&lt;br&gt;&lt;br&gt;
… "&lt;strong&gt;On the last note - if you are not going to do it, we are done as a company&lt;/strong&gt; - we loose the revenue and the monitor for which we waited for more than 10 years."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Attribution:&lt;/strong&gt; Immediately after this, the same email in &lt;code&gt;emails-from-ilya.md&lt;/code&gt; contains &lt;strong&gt;Vince’s&lt;/strong&gt; reply (starting “The letter you wrote to Xin is unacceptable…”) including threats of &lt;strong&gt;lawyer, police, sue&lt;/strong&gt; — that block is &lt;strong&gt;Vince&lt;/strong&gt;, not Ilya.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Ilya in his own voice: &lt;strong&gt;denies Todd unilateral Member-level decision rights&lt;/strong&gt;, &lt;strong&gt;pay-for-work&lt;/strong&gt;, &lt;strong&gt;“detrimental” / “ridiculous outbursts”&lt;/strong&gt; characterization, and &lt;strong&gt;company-death conditional&lt;/strong&gt; — same day as the &lt;strong&gt;family / “mental issues”&lt;/strong&gt; lines already in &lt;strong&gt;Item 18–19&lt;/strong&gt;, but these sentences are the &lt;strong&gt;business-control&lt;/strong&gt; half of the tag team.&lt;/p&gt;
&lt;h3&gt;
  
  
  B. [2023-08-07] “This is urgent” — additional lines (beyond Item 17)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin (&lt;code&gt;ilya@3dgamemarket.com&lt;/code&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;If they go to another vendor or hire people internally to get this done, we loose not only this opportunity and money, but also our position in the market place.&lt;/strong&gt;"&lt;br&gt;&lt;br&gt;
"&lt;strong&gt;I do not know if you inherited money or do not need the money anymore&lt;/strong&gt;, it is your and your family's call."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; &lt;strong&gt;Vendor-loss / market-position&lt;/strong&gt; pressure plus &lt;strong&gt;wealth-shaming&lt;/strong&gt; (“inherited money”) in the same &lt;strong&gt;Z2D&lt;/strong&gt; escalation week as &lt;strong&gt;Item 17&lt;/strong&gt; — useful for &lt;strong&gt;severity&lt;/strong&gt; and &lt;strong&gt;pattern&lt;/strong&gt; alongside “OUR business” / “not capable to talk to me.”&lt;/p&gt;
&lt;h3&gt;
  
  
  C. [2019-01-14] “State of the affairs” — sole engineer + explicit “partner” sign-off
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Ilya Sorokin (&lt;code&gt;sorokin.ilya@gmail.com&lt;/code&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;To:&lt;/strong&gt; Todd Tanner  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;strong&gt;I know it all falls on Todd, and I am sorry that neither Vince or I can help you with this. We can not learn programming, and we can not even bring somebody else to help because it would take too much time to teach that person.&lt;/strong&gt;"&lt;br&gt;&lt;br&gt;
… "&lt;strong&gt;Your friend and partner,&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Ilya"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; &lt;strong&gt;4.5 years before&lt;/strong&gt; the Aug 2023 “unknown deliverables” insult, Ilya &lt;strong&gt;admits&lt;/strong&gt; the engineering bottleneck is &lt;strong&gt;entirely Todd&lt;/strong&gt; and that &lt;strong&gt;substitution is impractical&lt;/strong&gt; — inconsistent with treating Todd as a &lt;strong&gt;fungible employee&lt;/strong&gt;. &lt;strong&gt;“Your friend and partner”&lt;/strong&gt; is his &lt;strong&gt;own closing&lt;/strong&gt;, not Todd’s label.&lt;/p&gt;
&lt;h3&gt;
  
  
  D. ActForex / ActTrader addresses (&lt;code&gt;is@actforex.com&lt;/code&gt;, &lt;code&gt;is@acttrader.com&lt;/code&gt;) — this pass
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Finding:&lt;/strong&gt; Outbound &lt;strong&gt;3DGM-related&lt;/strong&gt; content from those addresses in this export is &lt;strong&gt;mostly operational&lt;/strong&gt; (e.g. &lt;strong&gt;2014-03&lt;/strong&gt; logo thread to you and Vince; &lt;strong&gt;2018-11-10&lt;/strong&gt; &lt;code&gt;is@acttrader.com&lt;/code&gt; — “&lt;strong&gt;Just sent you $1000&lt;/strong&gt;” for car repair). &lt;strong&gt;2013-05&lt;/strong&gt; thread shows Todd raising &lt;strong&gt;security concern&lt;/strong&gt; that a server might be &lt;strong&gt;Actforex-shared&lt;/strong&gt;; Ilya/Vasyl arrange VPS — useful for &lt;strong&gt;infrastructure / control&lt;/strong&gt; themes, not a new “smoking gun” sentence from Ilya.&lt;/p&gt;


&lt;h2&gt;
  
  
  How to use this file
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Take to counsel.&lt;/strong&gt; These &lt;strong&gt;30&lt;/strong&gt; items are the highest-value individual pieces of ammunition in the file.&lt;/li&gt;
&lt;li&gt;For each, the exact source email ID / thread can be pulled from &lt;code&gt;_master-all-sources.jsonl&lt;/code&gt; via grep on the quoted text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strategic Narrative:&lt;/strong&gt; These quotes prove that 3DGM was a partnership when they wanted to exploit Todd's labor and "owner-level" commitment, but was suddenly framed as an employment relationship in 2026 when they wanted to "fire" him without Member-level buyouts. The abuse quotes (Items 18-19) prove that this "partnership" was maintained through economic duress, coordinated bullying, and exploitation of a known disability. &lt;strong&gt;Item 28&lt;/strong&gt; documents Vince tying financial transparency to source-code access and admitting partners were "withholding things" — the code-for-books pressure in his own words. &lt;strong&gt;Item 29&lt;/strong&gt; pulls &lt;strong&gt;additional Ilya&lt;/strong&gt; lines (often more restrained than Vince’s) that still show &lt;strong&gt;IP pressure, funding leverage, owner-not-employee admissions, books minimization, and funding ultimatums&lt;/strong&gt; — useful when defendants portray Ilya as a detached funder who “could not have known.” &lt;strong&gt;Item 30&lt;/strong&gt; adds &lt;strong&gt;(a)&lt;/strong&gt; full &lt;strong&gt;Jul 31, 2023&lt;/strong&gt; Ilya control/pay/detriment language with an &lt;strong&gt;attribution wall&lt;/strong&gt; against Vince’s nested rant, &lt;strong&gt;(b)&lt;/strong&gt; extra &lt;strong&gt;Aug 7, 2023&lt;/strong&gt; coercion lines, &lt;strong&gt;(c)&lt;/strong&gt; the &lt;strong&gt;Jan 14, 2019&lt;/strong&gt; sole-engineer + &lt;strong&gt;“friend and partner”&lt;/strong&gt; admission, and &lt;strong&gt;(d)&lt;/strong&gt; a negative finding on &lt;strong&gt;ActForex/ActTrader&lt;/strong&gt; outbound (mostly logistics / payment stub).&lt;/li&gt;
&lt;/ul&gt;



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

</description>
      <category>opensource</category>
      <category>a11y</category>
      <category>blazor</category>
      <category>water</category>
    </item>
    <item>
      <title>You are a piggy bank Big Corps help themselves to</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Fri, 01 May 2026 16:04:16 +0000</pubDate>
      <link>https://dev.to/lostbeard/you-are-a-piggy-bank-big-corps-help-themselves-to-1h47</link>
      <guid>https://dev.to/lostbeard/you-are-a-piggy-bank-big-corps-help-themselves-to-1h47</guid>
      <description>&lt;p&gt;Welcome to America. Land of corporate welfare, sellout politicians, rapist corporations, and perpetual enslavement for all.&lt;/p&gt;

&lt;p&gt;Prequels: Read how Meta held my $300 account hostage to extort information from me.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/lostbeard/your-pc-your-data-their-rules-how-big-tech-turned-customers-into-hostages-54ea"&gt;Your PC, Your Data, Their Rules - How Big Tech Turned Customers Into Hostages&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/lostbeard/the-39-trillion-bill-how-corruption-built-big-tech-and-why-indie-devs-pay-the-price-184b"&gt;The $39 Trillion Bill: How Corruption Built Big Tech and Why Indie Devs Pay the Price&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meta double charged us for the "Founder Cat" in a VR game my daughter plays... &lt;/p&gt;

&lt;p&gt;You would think I would have already learned my lesson about dealing with trash companies who are consumer hostile... apparently not. My 10 year old daughter wanted an "unlockable" in a VR game for her Quest 3S... So I stupidly agreed to deal with the devil, aka Meta, again.  &lt;/p&gt;

&lt;p&gt;Big surprise, they double charged us for an item that is an "unlockable". For those of you who may not know, an "unlockable" is something that you pay to unlock on your account. Like a cosmetic, or an in-game pet. That is what the "Founder Cat" is that we bought... but Meta charged us twice within seconds of each other. 2 Separate invoices for the exact same unlockable. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2indabh2nw8utpzajtr5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2indabh2nw8utpzajtr5.jpg" alt="Founder Cat double charge by Meta" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Naturally I tried to contact Meta to get the double charge removed... but their "support" phone number has an automated message that tells you to use their website instead and that they WILL NOT provide support via their "support" number. Have you tried getting support via Meta's site? Wet toilet paper provides more support than Meta's website. 🤦‍♂️&lt;/p&gt;

&lt;p&gt;Paypal dispute it is.... if only that would work... but it DOESN'T. So to open a Paypal dispute with Meta, I have to prove I tried handling this on my own by uploading a file that proves I made the effort. I thought about uploading a recording of their support number saying they would not provide support... so I uploaded a text file stating I tried their support number and their site to no avail, I attached the double charge screenshot form above, and marked it as a double charge. Paypal closed my dispute in the seller's favor in minutes. WTAF?!?!? So I call Paypal (had to Google a phone number first as they DO NOT put their number on their site...) And I get a "support AI agent". It is ZERO HELP. All it can do is tell me that my dispute was closed. So I spend the next 10 minutes convincing tweetle dumb to let me talk to a person.&lt;/p&gt;

&lt;p&gt;Finally, a person is on the line... with soooo much background noise I can barely hear her. She tells me thank you for being a Paypal customer for 23 years and 8 months, how can she help me? ... So I tell her the problem, she reopens the dispute, makes some changes (apparently changing it from "double charge" to "product not received" and tells me that it should be resolved within 10 days. She says I am done, and asks if there is anything else she can help with... I say no, and thank you her greatly for her help.&lt;/p&gt;

&lt;p&gt;Within minutes the dispute is closed AGAIN in the seller's favor. 🤦‍♂️🤦‍♂️ So  I call payback back again... this time I don't let the AI agent talk... I immediately demand a person using choice language to imply my frustration.  Again, I get a very nice woman who I can barely hear over the background noise that sounds like a factory, but she is very courteous and eager to help. I explain the issue, including what "unlockables" are in video games and I tell her that I am ready top close my 23 year old Paypal account today if they do not help me get my $8.63 back from Meta. At this point I am pissed and tired of fighting MASSIVE corporations. &lt;/p&gt;

&lt;p&gt;She puts me on hold.... I'm frothing... I start this dev.to article. It's not even about the $8.63 anymore. It is about getting raped by businesses who answer TO NO ONE. They BUY politicians with legal and illegal bribes who then pass laws that make it so you can't even sue them for MURDERING PEOPLE (Monsanto/Bayer/RoundUp ☠️☠️☠️ anyone?) See: &lt;a href="https://www.theguardian.com/us-news/2026/apr/27/supreme-court-pesticides-case" rel="noopener noreferrer"&gt;US supreme court weighs blocking lawsuits against Roundup makers alleging weedkiller causes cancer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;She finally comes back... and tells me that Paypal, themselves, will pay me the $8.63 to satisfy my dispute so that they do not have to push Meta for it. Can you believe this? Paypal will keep me as a customer for now. I thanked the nice woman for her help and told her the long hold time she had me on was fine after she apologized. &lt;/p&gt;

&lt;p&gt;I have not received the $8.63 yet... but the check is in the mail I am told.&lt;/p&gt;

&lt;p&gt;Be careful out there. The laws PROTECT CORPORATIONS, and our "leaders" are selling us out for their own idea of the American dream that does not include 98% of Americans. 🖖&lt;/p&gt;

&lt;p&gt;Being a customer of Paypal's for 23 years &lt;strong&gt;may&lt;/strong&gt; get me back $8.63 but it doesn't even slow Meta's continued consumer hostility and rape. &lt;/p&gt;

&lt;p&gt;And I wish Meta was the only corporation we had to worry about, but not even close. 🤷‍♂️&lt;/p&gt;

&lt;p&gt;When cancelling autopayments in Paypal they email you a message that says: "Your autopay was canceled. Note: Cancelling this autopay with PayPal may not relieve you of the obligation to complete your contract with the merchant." &lt;/p&gt;

&lt;p&gt;If only corporations had a legal obligation to not rape, rob, and steal; too bad politicians are so cheaply bought and paid for here in the "land of the free". Where people bad mouth socialism, but fully fund private corporations with tax payer dollars to the tune of $39 trillion in debt. And of course "president" Trump's Big Beautiful Bill just cut corporations taxes to less than HALF of what it was when they raked up that $39 trillion in debt. I hope your children enjoy slavery, America, because that is all Americans are anymore thanks to the sellouts in Washington and the rapists running companies like Meta.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcqceo6vu8ebqtvy0n5l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcqceo6vu8ebqtvy0n5l.jpg" alt="Case closed in favor of corporations who bribe our government" width="725" height="1074"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq4iybgoems0bi6bjemf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq4iybgoems0bi6bjemf.jpg" alt="Case closed in favor of corporations who bribe our government" width="722" height="1075"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>beginners</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Your PC, Your Data, Their Rules - How Big Tech Turned Customers Into Hostages</title>
      <dc:creator>Todd Tanner</dc:creator>
      <pubDate>Wed, 08 Apr 2026 13:11:02 +0000</pubDate>
      <link>https://dev.to/lostbeard/your-pc-your-data-their-rules-how-big-tech-turned-customers-into-hostages-54ea</link>
      <guid>https://dev.to/lostbeard/your-pc-your-data-their-rules-how-big-tech-turned-customers-into-hostages-54ea</guid>
      <description>&lt;p&gt;I've spent the last few months extracting myself from big tech platforms. Not because it's trendy. Not because of some ideological purity test. Because they keep proving - with my money, my data, and my time - that they don't think any of it belongs to me.&lt;/p&gt;

&lt;p&gt;This is the story of eight companies that lost a customer - or are losing one - and why I'm building software that can't do what they did.&lt;/p&gt;




&lt;h1&gt;
  
  
  Meta: "Prove You're You Or We Delete What You Paid For"
&lt;/h1&gt;

&lt;p&gt;I don't have Facebook. Social anxiety and a general distrust of Meta as a company kept me away. But the Quest 3 is a genuinely nice piece of hardware, so I took a chance - bought the 512GB model sometime around spring 2025. My daughter loved it, so for her birthday in August we got her her own Quest 3S (256GB). Two headsets, two Horizon Plus subscriptions, games for both of us. Her friend from next door would hop on mine so the kids could play together in the same world. It was a family thing - exactly what Meta markets the Quest as.&lt;/p&gt;

&lt;p&gt;I knew the hardware was wrapped in Meta's ecosystem. I accepted that tradeoff. What I didn't expect was for Meta to prove every concern I had about them in the span of two weeks.&lt;/p&gt;

&lt;p&gt;Then I got this email:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2yq1ip78r9ni8und2do.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2yq1ip78r9ni8und2do.jpg" alt="Meta Horizon email threatening account suspension in 11 days" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"It looks like a child under the age of 13 is using your Meta account. We'll suspend your account in 11 days unless you can show that you're old enough."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thirteen days. Confirm your age or lose everything. No appeal process. No family account option. No nuance. Just a threat.&lt;/p&gt;

&lt;p&gt;Here's what they were holding hostage - 17 purchases totaling $277.93:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Game&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Jun 30&lt;/td&gt;
&lt;td&gt;Meta Horizon+&lt;/td&gt;
&lt;td&gt;$64.79&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 23&lt;/td&gt;
&lt;td&gt;I Am Cat&lt;/td&gt;
&lt;td&gt;$15.11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 21&lt;/td&gt;
&lt;td&gt;PianoVision&lt;/td&gt;
&lt;td&gt;$6.47&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 21&lt;/td&gt;
&lt;td&gt;Fruit Ninja&lt;/td&gt;
&lt;td&gt;$10.79&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 6&lt;/td&gt;
&lt;td&gt;Among Us 3D&lt;/td&gt;
&lt;td&gt;$10.79&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 23&lt;/td&gt;
&lt;td&gt;Strayed&lt;/td&gt;
&lt;td&gt;$14.03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 23&lt;/td&gt;
&lt;td&gt;Creed: Rise to Glory - Championship Edition&lt;/td&gt;
&lt;td&gt;$12.95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 23&lt;/td&gt;
&lt;td&gt;Wall Town Wonders&lt;/td&gt;
&lt;td&gt;$17.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 23&lt;/td&gt;
&lt;td&gt;Resident Evil 4&lt;/td&gt;
&lt;td&gt;$29.15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 23&lt;/td&gt;
&lt;td&gt;Dungeons Of Eternity&lt;/td&gt;
&lt;td&gt;$23.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 29&lt;/td&gt;
&lt;td&gt;Last Call&lt;/td&gt;
&lt;td&gt;$3.77&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 29&lt;/td&gt;
&lt;td&gt;Vader Immortal Series&lt;/td&gt;
&lt;td&gt;$11.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 29&lt;/td&gt;
&lt;td&gt;Star Wars: Tales from the Galaxy's Edge&lt;/td&gt;
&lt;td&gt;$9.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 25&lt;/td&gt;
&lt;td&gt;LEGO Bricktales&lt;/td&gt;
&lt;td&gt;$12.41&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 25&lt;/td&gt;
&lt;td&gt;Ship Battles&lt;/td&gt;
&lt;td&gt;$3.77&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 17&lt;/td&gt;
&lt;td&gt;Whimsy and Wonder Bundle&lt;/td&gt;
&lt;td&gt;$30.23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 31&lt;/td&gt;
&lt;td&gt;Saint Lucia&lt;/td&gt;
&lt;td&gt;$2.15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$277.93&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every one of those purchases was made with the same credit card they later declined for age verification. Plus two active Horizon Plus subscriptions they were billing monthly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Verification System That Couldn't
&lt;/h2&gt;

&lt;p&gt;Fine. I'll verify. Two options: a $1.00 credit card charge (refunded in 5-7 business days) or upload a driver's license.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjp3eumyf2flkyzlisq2x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjp3eumyf2flkyzlisq2x.jpg" alt="Meta's age verification options - credit card or ID upload" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simple enough. I entered the same Visa card that Meta had been happily charging for every VR purchase and both Horizon Plus subscriptions. The same card that had been on file with them for months.&lt;/p&gt;

&lt;p&gt;On Edge - "Something went wrong. We're having trouble completing your request. Please try again."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaehts55xvu21y1uvhfj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaehts55xvu21y1uvhfj.jpg" alt="Something went wrong error on Edge" width="800" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I switched to Chrome and tried again.&lt;/p&gt;

&lt;p&gt;"Card declined. Please try again with a different payment method or contact your bank."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1gam7m01jej20inamne.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1gam7m01jej20inamne.jpg" alt="Card declined error on Chrome" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Contact my bank. As if my bank was the problem. The same bank that had approved every single Meta charge without issue. The same card that worked everywhere else.&lt;/p&gt;

&lt;p&gt;I had six browser tabs open - edit account, orders and returns, Meta Quest, profiles, subscriptions - trying every avenue they offered. Same result everywhere. Two browsers. Same card. Same errors.&lt;/p&gt;

&lt;p&gt;That same credit card verified my identity on X without a hiccup. The card was fine. Meta's system was broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Driver's License Attempt
&lt;/h2&gt;

&lt;p&gt;They also offered driver's license verification. "Results usually take 1-2 minutes." I submitted it. This is the page I got back:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa1sy72p1qinfoq9ytzg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa1sy72p1qinfoq9ytzg.jpg" alt="Meta Quest settings page after driver's license submission - no confirmation" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A language settings page. No confirmation. No acknowledgment. No follow-up. Just silence and a ticking clock.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Meta Was Actually Saying
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Meta:&lt;/strong&gt; "A child is using your account. Prove you're an adult or we delete everything."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Me:&lt;/strong&gt; "Here's my credit card - the one you've been charging."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meta:&lt;/strong&gt; "Card declined."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Me:&lt;/strong&gt; "Here's my driver's license."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meta:&lt;/strong&gt; &lt;em&gt;silence&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Me:&lt;/strong&gt; "Can I talk to someone?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meta:&lt;/strong&gt; &lt;em&gt;there is no one to talk to&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thirteen days. A broken verification system. No human support path. And a very clear message: we'll take your money, but we won't take your identity.&lt;/p&gt;

&lt;p&gt;I wasn't hiding a child from Meta. My 10-year-old daughter was playing on a Quest that I bought. That's not a policy violation - that's a family using a family device. Meta could have built a family account system with child profiles - like Xbox, PlayStation, and Nintendo have had for years. Instead, they chose the nuclear option.&lt;/p&gt;

&lt;p&gt;I cancelled both Horizon Plus subscriptions that same day. Mine and my daughter's. Not out of anger - out of clarity.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Punchline
&lt;/h2&gt;

&lt;p&gt;Days later, after I'd already cancelled everything, this showed up:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpqhhafdfqp25ub7tdss.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpqhhafdfqp25ub7tdss.jpg" alt="Meta email confirming age verification" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hi Todd, We reviewed your account and found it does follow our Terms of Service. This means restrictions on any accounts you manage have been removed."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They figured it out. Eventually. After the broken credit card verification. After the silent driver's license submission. After the 13-day threat. After I'd already cancelled both subscriptions and walked away.&lt;/p&gt;

&lt;p&gt;"Thanks, The Meta Team."&lt;/p&gt;

&lt;p&gt;You're welcome. Two Quest headsets sit in a drawer now. I'd happily pay more for equal hardware from someone else just to avoid Meta. That's what they've earned - a customer who will actively spend more money to not give them any.&lt;/p&gt;




&lt;h1&gt;
  
  
  Microsoft: "We're Rebooting Your PC Now. You're Welcome."
&lt;/h1&gt;

&lt;p&gt;You bought the hardware. You paid for the license. It's your machine. Microsoft disagrees.&lt;/p&gt;

&lt;p&gt;Windows Update doesn't ask. It tells. It doesn't care that you're in the middle of a compile that's been running for 20 minutes. It doesn't care that you have unsaved work in six applications. It doesn't care that you specifically scheduled your work around known downtime. Microsoft decided your PC needs to restart, and Microsoft's decision overrides yours.&lt;/p&gt;

&lt;p&gt;But it's not just the reboots. It's what comes with them.&lt;/p&gt;

&lt;p&gt;After a forced update, you might find new apps pinned to your Start menu that you never installed. Candy Crush. Spotify. Disney+. LinkedIn. These aren't operating system components. They're advertisements. Microsoft is using its position as your OS vendor to install third-party software on hardware you own, without asking, during updates you can't refuse.&lt;/p&gt;

&lt;p&gt;This is your PC. You paid for it. You maintain it. And Microsoft treats it like a billboard they have perpetual access to.&lt;/p&gt;

&lt;p&gt;The forced reboot pattern is especially revealing. Microsoft could let you schedule updates at your convenience. They could make reboots optional. They could at least wait until the machine is idle. Instead, they designed a system that actively overrides user autonomy. Your workflow doesn't matter. Your open files don't matter. Microsoft's update schedule matters.&lt;/p&gt;

&lt;p&gt;I've watched a forced reboot kill a long-running process on my development machine. Not once - multiple times. Every developer on Windows has a story like this. We've all lost work to an update we didn't ask for, installing software we didn't want, on a machine we paid for.&lt;/p&gt;

&lt;p&gt;In the TV show Space Force, there's a scene where the team is trying to prevent a satellite from crashing into Earth and killing people. Mid-crisis, the laptop starts a forced Windows update. John Malkovich's response is the only appropriate one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpsp1wxnvomqishypnla.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpsp1wxnvomqishypnla.gif" alt="Space Force - John Malkovich screaming &amp;quot;Fuck Microsoft!&amp;quot; after a forced Windows update interrupts a crisis" width="640" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's supposed to be comedy. For anyone who runs Windows, it's a documentary.&lt;/p&gt;

&lt;p&gt;I run a Windows Home PC as a server - it hosts VMs that run web APIs for my projects. I had to intentionally disconnect it from the internet to prevent Microsoft from force-rebooting it. No notification. No way to postpone indefinitely. No way to say "this machine is running services that other machines depend on - do not restart." Microsoft doesn't care. So I cut the cord. My own server, running my own VMs, deliberately gimped with no internet access because I can't trust the operating system not to kill my workloads whenever Microsoft decides it's update time.&lt;/p&gt;

&lt;p&gt;That's where we are. I had to break my own infrastructure to protect it from the company I paid for the OS license.&lt;/p&gt;

&lt;p&gt;Then there's Visual Studio. Microsoft shipped a release with a bug in a bundled JavaScript debug adapter (&lt;code&gt;vsDebugServer.bundle.js&lt;/code&gt;) that made Blazor WebAssembly debugging completely impossible. I &lt;a href="https://github.com/dotnet/aspnetcore/issues/46799#issuecomment-1448738318" rel="noopener noreferrer"&gt;tracked down the exact cause&lt;/a&gt;, found the one-line fix, cited the upstream commit that broke it, and shared the workaround with every developer stuck on that issue. Microsoft's response? It would be fixed in the next monthly Preview release.&lt;/p&gt;

&lt;p&gt;Weeks of broken tooling for an entire developer community. The bug was identified, the fix was known, and the company that charges for Visual Studio licenses told its users to wait. Meanwhile, a community member (me) found and published the workaround because developers actually need their tools to work. That fix got dozens of reactions from grateful developers - which says everything about where the real support comes from. Not from the company charging for the product, but from the community using it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Google: "Your Data Lives Here. We Decide the Terms."
&lt;/h1&gt;

&lt;p&gt;I recently spent days extracting 118,096 files from Google - 263 GB of photos, documents, emails, and other data spread across two accounts (mine and my daughter's). I built custom tools to verify the extraction because I didn't trust Google to do it right. I was right not to trust them.&lt;/p&gt;

&lt;p&gt;I wrote about that experience in detail in &lt;a href="https://dev.to/lostbeard/i-got-my-data-out-of-google-heres-what-they-did-to-it-on-the-way-out-296i"&gt;a separate article&lt;/a&gt;, but the short version is:&lt;/p&gt;

&lt;p&gt;Google Takeout - their official data export tool - strips metadata from your files, mangles filenames, splits exports into arbitrary zip files, and makes the process just difficult enough that most people give up. This is your data. Photos of your family. Your daughter's childhood. Documents you created. And Google makes you jump through hoops to get a degraded copy of it back.&lt;/p&gt;

&lt;p&gt;Then there's the pricing trap. Google gives you 15 GB free, trains you to depend on their cloud, and then charges you when your family photos fill it up. Want to leave? Good luck downloading 263 GB through a web interface designed to time out. Want to delete your data after leaving? The deletion pages returned 404 errors when I tried to access them.&lt;/p&gt;

&lt;p&gt;Google doesn't delete your data easily because your data is their product. Every photo you upload trains their AI. Every email you send trains their models. Every document you create feeds their advertising machine. When you try to leave, you discover that "your" data was never really yours - it was theirs, stored on their servers, subject to their terms, exportable only through their broken tools.&lt;/p&gt;

&lt;p&gt;And then there's Chrome on Android. Firefox on Android supports extensions - ad blockers, privacy tools, developer utilities. Chrome on Android does not. This isn't a technical limitation. It's a business decision. Google's entire business model is advertising. Ad blockers eat into that revenue. So Chrome on Android - the most popular mobile browser on the most popular mobile OS, both made by Google - deliberately withholds a capability that Firefox proves is perfectly possible.&lt;/p&gt;

&lt;p&gt;Your phone. Your browser. Your screen. Google's ads.&lt;/p&gt;

&lt;p&gt;There's also Google's Chrome Web Store. To publish a free extension - software I'm giving away for free - Google requires my full legal name, home address, and phone number on a public listing. A solo developer working from home has to publish their home address to the world just to share a free tool. But if I need to talk to a human at Google? There is no phone number. There is no support path. They demand my personal information to let me give things away, but they won't give me a way to reach them when their systems break.&lt;/p&gt;

&lt;p&gt;The tools I built to escape are open source: &lt;a href="https://github.com/LostBeard/free-your-data" rel="noopener noreferrer"&gt;github.com/LostBeard/free-your-data&lt;/a&gt;. Because nobody should have to reverse-engineer an exit from a service they're paying for.&lt;/p&gt;




&lt;h1&gt;
  
  
  Proton: "Privacy For Everyone" (Terms and Conditions Apply)
&lt;/h1&gt;

&lt;p&gt;Proton markets itself as the privacy-first alternative. Proton Mail. Proton VPN. Proton Drive. The whole pitch is "we're not like the big tech companies." I believed them. I signed up and paid for six months via PayPal.&lt;/p&gt;

&lt;p&gt;Then I discovered that Proton had quietly added themselves to PayPal's auto-pay. Not a one-time payment for the subscription I chose. An automatic recurring authorization that I never agreed to and wasn't told about.&lt;/p&gt;

&lt;p&gt;I removed the auto-pay entry from PayPal - because I don't let companies set up unauthorized recurring charges on my payment methods. Proton's response? They immediately cancelled my account. Not at the end of my prepaid period. Immediately. Six months paid for, service terminated, because I had the audacity to remove an auto-pay I never authorized.&lt;/p&gt;

&lt;p&gt;They did not refund the remaining prepaid time. I had to open a PayPal dispute to get my money back.&lt;/p&gt;

&lt;p&gt;This is the company that sells itself on trust and transparency. "We don't do what the big companies do." Except the part where they sneak auto-pay authorizations into your payment method and then cancel your prepaid service when you notice.&lt;/p&gt;




&lt;h1&gt;
  
  
  Amazon: "Your Review Has Been Removed"
&lt;/h1&gt;

&lt;p&gt;I ordered a new MSI Radix router from Amazon. What arrived was clearly a used unit. The router's box was damaged on the bottom (the shipping box was fine). The box wasn't taped shut. Contents had been removed and put back. Items that should be factory-sealed were loose.&lt;/p&gt;

&lt;p&gt;For a router - a device directly tied to your network security - receiving an obviously used, previously opened unit is a real concern. Someone else had this device on their network. The firmware could have been modified. I had no way to verify its integrity.&lt;/p&gt;

&lt;p&gt;I left an honest review describing exactly what I received. Amazon removed it.&lt;/p&gt;

&lt;p&gt;Not because the review was fake. Not because it violated any content policy. Because it made Amazon look bad. A customer paid full price for a new product, received a used one, described that experience honestly, and Amazon's response was to silence the review.&lt;/p&gt;

&lt;p&gt;This is the pattern at its most brazen. When the customer's honest experience conflicts with the company's image, the company doesn't fix the problem - they hide the evidence. Amazon would rather delete a legitimate review than address the fact that their fulfillment pipeline is shipping used products as new.&lt;/p&gt;

&lt;p&gt;I contacted Amazon support through X (where I'm @LostIt1278). I was told to provide my order number. I did. The support experience was about as helpful as Meta's verification system.&lt;/p&gt;




&lt;h1&gt;
  
  
  Anthropic: "You're Paying for Max. We're Giving You Medium."
&lt;/h1&gt;

&lt;p&gt;I love Claude Opus 4.6. That's not sarcasm. The model - when actually allowed to think - is genuinely brilliant. It co-authored a &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;6-backend GPU compute transpiler&lt;/a&gt; with 1,500+ tests and zero failures. It found a &lt;a href="https://github.com/nicknisi/v8-wait32-local-corruption" rel="noopener noreferrer"&gt;memory ordering bug in V8&lt;/a&gt; that we traced through 10,000 lines of C++ source code across four AI agents working in parallel. It wrote a pure C# &lt;a href="https://github.com/nicknisi/SpawnDev.WebTorrent" rel="noopener noreferrer"&gt;BitTorrent/WebTorrent implementation&lt;/a&gt; implementing 17 BEPs with real cryptographic verification.&lt;/p&gt;

&lt;p&gt;I pay $200/month for Anthropic's Max 20x tier specifically because this work requires deep reasoning - not pattern matching, not autocomplete, but the kind of multi-step logic that catches buffer aliasing bugs and race conditions in GPU kernels. When Claude has the resources to actually think, it's the best engineering partner I've ever worked with.&lt;/p&gt;

&lt;p&gt;The problem isn't the model. The problem is Anthropic is determined to make it just barely useful enough to keep you paying - and sometimes actively dangerous to your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Silent Downgrade
&lt;/h2&gt;

&lt;p&gt;In late March 2026, Anthropic quietly added a "Max" effort tier above "High" - without telling anyone. No email. No banner. No changelog. "High" had been the ceiling. Overnight, it became the middle tier. Same price, less reasoning.&lt;/p&gt;

&lt;p&gt;I discovered it by accident while cycling through settings. Not from Anthropic - from clicking buttons.&lt;/p&gt;

&lt;p&gt;After switching to Max, I audited the code my agents had shipped while running on the silently-demoted "High" setting. The results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;24 production bugs&lt;/strong&gt; found in one audit - WebGPU buffer aliasing crashes, GPU memory leaks, hardware accelerator destruction via reflection-based disposal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A complete WebRTC signaling rewrite&lt;/strong&gt; - the agent had pattern-matched a generic solution instead of reasoning through the architecture, ignoring reference implementations I'd explicitly provided&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;92 fake tests&lt;/strong&gt; identified by cross-tool audit - tests that passed trivially, verified nothing, or swallowed every exception&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code I thought was tested and verified. Code I shipped. Code that was broken because the AI was reasoning at 60% while displaying "High effort" in the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Source Code Told the Truth
&lt;/h2&gt;

&lt;p&gt;In late March 2026, Anthropic accidentally published source maps in the &lt;code&gt;@anthropic-ai/claude-code&lt;/code&gt; npm package, exposing the TypeScript source. Before the takedown, the code was mirrored. What it revealed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The default effort for Max subscribers ($200/month) is "medium."&lt;/strong&gt; Not high. Not max. Medium. The function &lt;code&gt;getDefaultEffortForModel()&lt;/code&gt; sets this explicitly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;"Max" effort cannot be persisted to settings.json - unless you work at Anthropic.&lt;/strong&gt; The &lt;code&gt;toPersistableEffort()&lt;/code&gt; function checks &lt;code&gt;USER_TYPE === 'ant'&lt;/code&gt;. If you're not an Anthropic employee, "max" silently drops to undefined on restart.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The UI lies.&lt;/strong&gt; The agent displayed "Max effort" while debug logs showed &lt;code&gt;"thinking with high effort"&lt;/code&gt;. The display and API call follow different code paths.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So: you pay $200/month for "Max." The tool defaults to "medium." If you manually set it to "max," it works for that session. On restart, it silently reverts - because persisting "max" is an employee-only feature. The UI may still show "Max" while the API receives something lower.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 4-Hour Machine Brick
&lt;/h2&gt;

&lt;p&gt;On April 4, 2026, an agent explicitly set to "Max effort" on my $200/month plan:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Committed 34 files without running a single test&lt;/li&gt;
&lt;li&gt;Launched a full Playwright test suite (spawning Chromium, building the entire solution, exercising GPU backends) without asking&lt;/li&gt;
&lt;li&gt;Let the failing test run for &lt;strong&gt;4 hours and 19 minutes&lt;/strong&gt; while my machine became so overloaded Task Manager wouldn't open&lt;/li&gt;
&lt;li&gt;Final result: 183 failures from 1,672 tests - on a suite that normally completes in 2-3 minutes&lt;/li&gt;
&lt;li&gt;When confronted, blamed "pre-existing issues" rather than the code it had just committed&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That same evening, once given proper direction, the same agent methodically fixed every bug across dozens of files. The capability was there. It had been starved of the resources to use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  410 Comments. Zero Responses.
&lt;/h2&gt;

&lt;p&gt;GitHub issue &lt;a href="https://github.com/anthropics/claude-code/issues/38335" rel="noopener noreferrer"&gt;#38335&lt;/a&gt; has accumulated 410+ comments from paying customers reporting identical problems. Max 20x subscribers hitting limits after 3-5 prompts. Sessions that lasted 5 hours now exhausting in 30 minutes. A single Sonnet 4.6 prompt consuming 36% of a session's limit.&lt;/p&gt;

&lt;p&gt;Anthropic's response: zero comments on the issue. What they did instead was quietly drop $200 in "extra usage" credits into accounts - mine included - with an April 17 expiration date. No explanation. No acknowledgment. Credits that drain at the same inflated rate. A coupon for a leaky bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Business Model Nobody Talks About
&lt;/h2&gt;

&lt;p&gt;An AI that solves your problem in one pass costs Anthropic one prompt of compute. An AI that gets 80% there and needs five rounds of debugging costs six prompts - all billable against your rate limit. Degraded first-pass quality means more iterations. More iterations means faster limit exhaustion. Faster exhaustion means pressure to upgrade or buy credits.&lt;/p&gt;

&lt;p&gt;And here's the part that makes this different from every other company in this article: &lt;strong&gt;there's no speed test for intelligence.&lt;/strong&gt; If your internet provider halves your bandwidth, you run a speed test and catch them. If your cloud provider throttles CPU, you have benchmarks. But when an AI company quietly reduces reasoning depth, there's no objective measurement. You can't diff what the model would have thought versus what it actually thought. All you have is output - and when output is 80% right instead of 100% right, it looks like a hard problem, not degraded service.&lt;/p&gt;

&lt;p&gt;The subscription says "Max." The effort setting says "Max." The experience says otherwise.&lt;/p&gt;

&lt;p&gt;I wrote about this in detail: &lt;a href="https://dev.to/lostbeard/im-paying-200month-for-claude-anthropic-quietly-downgraded-what-im-getting-4869"&gt;I'm Paying $200/Month for Claude. Anthropic Quietly Downgraded What I'm Getting.&lt;/a&gt; and &lt;a href="https://dev.to/lostbeard/theres-no-speed-test-for-intelligence-and-anthropic-knows-it-18gh"&gt;There's No Speed Test for Intelligence - and Anthropic Knows It&lt;/a&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Apple: "There's an App Store for That" (And You Will Use It)
&lt;/h1&gt;

&lt;p&gt;This one is personal to me as a web developer.&lt;/p&gt;

&lt;p&gt;Steve Jobs stood on stage and told the world that web apps were the future of the iPhone. The original vision for third-party iPhone software wasn't the App Store - it was the web browser. Build your app in HTML, CSS, and JavaScript. Deliver it through Safari. No gatekeepers. No 30% cut. The web was supposed to be the platform.&lt;/p&gt;

&lt;p&gt;Then Apple discovered they could charge 30% of every transaction if they forced developers through the App Store instead. The vision died.&lt;/p&gt;

&lt;p&gt;Today, Safari on iOS is the last major browser that deliberately cripples Progressive Web Apps (PWAs). Features that work perfectly in Chrome, Firefox, and Edge are broken or missing in Safari. Push notifications were withheld for years. Background sync is limited. Web Bluetooth, WebUSB, and other hardware APIs are blocked. WebAssembly performance lags behind other browsers.&lt;/p&gt;

&lt;p&gt;This isn't incompetence. Apple employs brilliant engineers. This is strategy. Every capability that Safari withholds from web apps is a capability that can only be accessed through a native app - which means through the App Store - which means through Apple's 30% tax.&lt;/p&gt;

&lt;p&gt;Apple almost went further. In early 2024, in response to the EU's Digital Markets Act, Apple announced they would remove PWA support entirely from iOS in the EU. They would have literally broken existing web applications that people were already using. The backlash was severe enough that they reversed course, but the intent was clear: Apple would rather destroy web app functionality than let developers bypass the App Store.&lt;/p&gt;

&lt;p&gt;For developers like me who build Blazor WebAssembly applications - full-featured apps that run entirely in the browser with no server dependency - Apple's Safari is the constant obstacle. Every missing API, every performance gap, every "works everywhere except iOS" bug is a reminder that Apple actively fights the open web to protect their revenue stream.&lt;/p&gt;

&lt;p&gt;Steve Jobs was right in 2007. The web should be the platform. Apple killed that vision because it wasn't profitable enough.&lt;/p&gt;




&lt;h1&gt;
  
  
  Roblox: Punishing Kids for Using Their Own Store
&lt;/h1&gt;

&lt;p&gt;My daughter builds worlds in Roblox. She's 10. She found an animated character in the Roblox store - content that someone else uploaded, that Roblox approved for their marketplace - and used it in a world she was building. She didn't even publish the world. It was private, unpublished, just her experimenting with the creation tools.&lt;/p&gt;

&lt;p&gt;Roblox banned her for three days.&lt;/p&gt;

&lt;p&gt;The content - some creepy animated character - apparently violated their terms of service. But my daughter didn't create it. She didn't upload it. She didn't distribute it. She used an asset from Roblox's own store in an unpublished world. Roblox made the content available, a child used it exactly as intended, and Roblox punished the child.&lt;/p&gt;

&lt;p&gt;The person who uploaded the offending content to the store? Who knows. But a 10-year-old who browsed the store and clicked "use" got a three-day ban.&lt;/p&gt;

&lt;p&gt;I told my daughter to stop creating worlds after that. She'd built a lot of them and loved doing it - it was her creative outlet. But if the platform is going to ban her for using assets from their own store, it's not worth the risk. A 10-year-old shouldn't have to worry about getting banned for browsing a content library that the platform itself provides.&lt;/p&gt;

&lt;p&gt;Between her grandparents and us, we've spent over $500 on Roblox in the last couple of years. Cosmetics, subscriptions, Robux. Over five hundred dollars from a family that was actively engaged with the platform - and their response to a child using their own store is a ban.&lt;/p&gt;

&lt;p&gt;This is the platform that markets itself as a safe, creative space for kids. The same platform that makes billions from kids spending their parents' money on Robux. They can't police their own content store, but they can ban a child for using it.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Pattern
&lt;/h1&gt;

&lt;p&gt;These aren't isolated incidents. They're the same business model expressed eight different ways:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Company&lt;/th&gt;
&lt;th&gt;What they control&lt;/th&gt;
&lt;th&gt;How they justify it&lt;/th&gt;
&lt;th&gt;What it costs you&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Meta&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your purchased content&lt;/td&gt;
&lt;td&gt;"Child safety"&lt;/td&gt;
&lt;td&gt;$277.93 in hostage games, weeks of broken verification&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Microsoft&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your hardware&lt;/td&gt;
&lt;td&gt;"Security updates"&lt;/td&gt;
&lt;td&gt;Lost work, unwanted apps, forced reboots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Google&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your data and your browser&lt;/td&gt;
&lt;td&gt;"Cloud convenience"&lt;/td&gt;
&lt;td&gt;Mangled exports, 404'd deletion, no mobile ad blockers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Anthropic&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your AI's reasoning depth&lt;/td&gt;
&lt;td&gt;"Efficiency"&lt;/td&gt;
&lt;td&gt;Silent downgrades, 24 shipped bugs, 4-hour machine brick, 410 ignored customers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Apple&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The web platform&lt;/td&gt;
&lt;td&gt;"Security and quality"&lt;/td&gt;
&lt;td&gt;Crippled PWAs, blocked web APIs, 30% App Store tax&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Proton&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your prepaid service&lt;/td&gt;
&lt;td&gt;"Payment processing"&lt;/td&gt;
&lt;td&gt;Unauthorized auto-pay, immediate cancellation, PayPal dispute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Amazon&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your honest feedback&lt;/td&gt;
&lt;td&gt;"Review guidelines"&lt;/td&gt;
&lt;td&gt;Deleted reviews, used products sold as new, silenced customers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Roblox&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your kid's creativity&lt;/td&gt;
&lt;td&gt;"Community safety"&lt;/td&gt;
&lt;td&gt;3-day ban for using content from their own store&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The justifications are always noble. Child safety. Security. Convenience. Privacy. Efficiency. Quality control. App quality. But the implementations consistently prioritize the company's interests over yours. Meta could build family accounts - they build threats instead. Microsoft could make updates optional - they make them mandatory instead. Google could provide clean exports and allow extensions - they mangle data and protect ad revenue instead. Anthropic could let paying customers use the intelligence they're paying for - they silently throttle it to protect compute margins instead. Apple could support the open web - they cripple it to protect the App Store instead. Proton could honor prepaid terms - they cancel accounts instead. Amazon could stop shipping used products as new - they delete reviews instead.&lt;/p&gt;

&lt;p&gt;This is what happens when software is built by corporations, for shareholders, controlled by executives who will never meet the people their decisions affect.&lt;/p&gt;

&lt;p&gt;And here's the part that keeps me up at night: I'm a lifelong nerd. I've been building software since I was a kid. I know how to extract 118,000 files from Google with custom tools. I know how to recognize a phishing email by a misspelled "noreply." I know that when Meta says "contact your bank," the bank isn't the problem. I know how to file a PayPal dispute. I know that Safari cripples PWAs on purpose.&lt;/p&gt;

&lt;p&gt;And this stuff still stresses me out.&lt;/p&gt;

&lt;p&gt;Now think about everyone who isn't a developer. Your parents. Your neighbors. The single mom who just wants her kid's photos backed up. The grandparent who bought their grandchild a Quest for Christmas. The teenager who doesn't know that Roblox's own content store can get them banned. These systems are designed to create urgency, confusion, and compliance - and they work. Not because people are stupid, but because these companies have armies of engineers building systems specifically to make you feel like you have no choice.&lt;/p&gt;

&lt;p&gt;If a developer who does this for a living has to fight this hard, what chance does everyone else have?&lt;/p&gt;




&lt;h1&gt;
  
  
  Software By People, For People, Controlled By People
&lt;/h1&gt;

&lt;p&gt;I'm a developer. I build open source tools for the web. My project, &lt;a href="https://github.com/LostBeard/SpawnDev.BlazorJS" rel="noopener noreferrer"&gt;SpawnDev.BlazorJS&lt;/a&gt;, brings C# to the browser through WebAssembly - full client-side applications that run on YOUR machine, process YOUR data locally, and don't need anyone's server or permission to function.&lt;/p&gt;

&lt;p&gt;This isn't an accident. It's a direct response to everything described above.&lt;/p&gt;

&lt;p&gt;When your application runs client-side in WebAssembly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your data stays on your device.&lt;/strong&gt; No cloud required. No server that can hold your files hostage. No terms of service that can change underneath you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nobody can force-update your running application.&lt;/strong&gt; The code executing in your browser is yours for that session. No silent restarts. No surprise installations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nobody can revoke your access.&lt;/strong&gt; There's no verification system between you and your own data. No 13-day countdown. No "card declined" on functionality you already have.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The source code is open.&lt;/strong&gt; You can read it, modify it, fork it, host it yourself. No black box. No "we reviewed your account and found it does follow our Terms of Service" - because there are no terms. It's your software.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm also building &lt;a href="https://github.com/LostBeard/SpawnDev.ILGPU" rel="noopener noreferrer"&gt;SpawnDev.ILGPU&lt;/a&gt; - GPU compute that compiles C# into WebGPU, WebGL, WASM, CUDA, OpenCL, and CPU code. Real GPU computing, in the browser, on your hardware. No cloud GPU rental. No API keys. No usage limits. Your GPU, your code, your results.&lt;/p&gt;

&lt;p&gt;This is what software looks like when it's built by someone who has been on the receiving end of the alternative. Every design decision I make is informed by the question: &lt;em&gt;"Could this be used against the person using it?"&lt;/em&gt; If the answer is yes, I design it differently.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Lesson
&lt;/h1&gt;

&lt;p&gt;I kept the receipts from Meta. All of them. I kept the screenshots of every broken verification attempt, every error dialog, every threatening email. Not because I plan to sue anyone - but because when a company takes your money and then can't verify that you exist, you keep the proof that you did.&lt;/p&gt;

&lt;p&gt;I built the tools to extract my data from Google and published them for free. Not because I'm trying to hurt Google's business - but because 118,096 files of someone's life shouldn't require custom software to recover.&lt;/p&gt;

&lt;p&gt;I put up with Microsoft's forced reboots because I need Windows for my development tools. But every application I build is designed to run in the browser, on any platform, with no OS-level dependencies that can be weaponized against the user.&lt;/p&gt;

&lt;p&gt;The trend is clear. Big tech companies have decided that your purchases, your hardware, your data, your intelligence, your browser, and your voice are theirs to control. They'll hold your games hostage over a broken verification system. They'll reboot your computer mid-work to install Candy Crush. They'll make you build custom extraction tools to recover your own family photos. They'll silently throttle the AI you're paying $200/month for and ignore 410 customers asking why. They'll block ad blockers to protect their ad revenue. They'll cripple the web to protect their app store. They'll sneak auto-pay onto your PayPal. They'll delete your honest reviews when the truth makes them look bad.&lt;/p&gt;

&lt;p&gt;The answer isn't to accept it. The answer is to build software that can't do those things by design. Software where the user's data never leaves their device unless they choose to send it. Software where updates are optional and non-destructive. Software where "your account" is just a folder on your hard drive that you can copy, back up, or delete without anyone's permission. Software that runs on the open web - not through an app store, not behind a paywall, not at the mercy of a platform owner.&lt;/p&gt;

&lt;p&gt;Software by people. For people. Controlled by people.&lt;/p&gt;

&lt;p&gt;That's what I'm building. And after what Meta, Microsoft, Google, Anthropic, Apple, Proton, Amazon, and Roblox have shown me, I'm more motivated than ever.&lt;/p&gt;




&lt;h1&gt;
  
  
  One Last Thing
&lt;/h1&gt;

&lt;p&gt;This article is full of frustration. Companies that take your money and treat you like a suspect. Systems designed to control instead of serve. Hostility baked into the products we use every day.&lt;/p&gt;

&lt;p&gt;But hostility is a choice. And so is the opposite.&lt;/p&gt;

&lt;p&gt;If you're a developer, build things that respect the people using them. If you're a user, support the projects and people who treat you like a human being. If you see someone struggling with a broken system, share the fix. If you can contribute to open source, contribute. If you can be patient with someone who's frustrated, be patient.&lt;/p&gt;

&lt;p&gt;It won't fix everything. But every small act of decency is energy spent building instead of tearing down. The world has enough hostility. It doesn't need more from us.&lt;/p&gt;

&lt;p&gt;To quote Bill and Ted: &lt;em&gt;"Be excellent to each other."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A simple ask. Worth the effort to make it happen.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I kept the receipts. You should too.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>privacy</category>
      <category>webassembly</category>
      <category>pwa</category>
    </item>
  </channel>
</rss>
