Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
165924 stories
·
33 followers

#590 - 29th November 2026

1 Share

Hopefully you've all finally finished reading last week's epic Ignite 2026 round-up? Thankfully this week is a little quieter. Highlights include:

Some notices worth being aware of:

Finally, I thoroughly enjoyed reading (and getting distracted by) this post:

  • From 8086 to AI: Teaching a Model to Play Xenon 2 by Richard Astbury - The project reconstructs the 1989 DOS game Xenon 2 into a native JavaScript browser app using GitHub Copilot, highlighting challenges such as network latency and the need for precise code verification.
Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

WebGPU Demystified For .NET Apps

1 Share
&&
WebGPU Rendering Uno Platform 7.0
Why It Matters

WebGPU gives developers modern, cross-platform access to the GPU – graphics and compute – and Uno Platform 7.0 puts it right besides your XAML, with SkiaSharp as the safety net.

The GPU in your users’ machines is a monster – thousands of cores, built to do one thing at staggering scale. And for most of the web’s history, we’ve been peeking at it through a keyhole.

That has changed. WebGPU has been shipping in every major browser for more than a year now, and with Uno Platform 7.0 it’s no longer just a browser story. It’s a .NET story, a cross-platform story, and – let’s be honest – a pretty fun one.

So what is WebGPU, really? Why should you care if you build business apps and not games? And what happens when you mix it straight into XAML? Let’s unpack ..

Basics

WebGPU Basics

What is WebGPU

WebGPU is a W3C-standardized API for cross-platform, efficient access to the GPU. It sits on top of whatever modern graphics stack the system already has – Vulkan, Metal, or Direct3D 12 – and gives you one consistent way to talk to all of them. It’s designed to supersede WebGL as the main graphics standard for the web.

Despite the “Web” in the name, it isn’t browser-only. Native implementations are usable from Rust, C++, and C, and runtimes like Deno and Node.js can use it too. The browser is where it started – not where it ends.

To make the idea click, picture a stadium card stunt. Thousands of fans each hold up a colored card, and from across the arena the crowd forms one image. The organizer doesn’t hand out 50,000 individual instructions. They hand out one sheet – “look at your seat number, work out your color” – and every fan follows it with their own seat as the input.

That’s a GPU:

  • 🏟 The crowd is thousands of tiny cores
  • 📋 The instruction sheet is a shader – one small program, run by every core
  • 🪑 The seat number is each core’s input – a pixel position, a particle index, a vertex

WebGPU is how you hand the instruction sheet to the stadium.

Why developers should care

The reality is you don’t need to be building a game for this to matter.

  • Modern GPU access. WebGL was designed around an older generation of graphics APIs. WebGPU maps to how modern GPUs actually work.
  • Compute, not just graphics. First-class support for general-purpose GPU computation – libraries like ONNX Runtime and Transformers.js use it for machine learning inference in the browser. Particle systems, image processing, simulation – all fair game.
  • A real ecosystem. Three.js, Babylon.js, PlayCanvas, and Unity all support it.
  • One API, every GPU stack. The same code runs over Vulkan, Metal, or Direct3D 12 depending on where it lands.

The tradeoff? Explicit control means more setup. Power with ceremony.

WebGPU Shading Language (WGSL) Basics

Shaders in WebGPU are written in WGSL, specified separately by the W3C. If you’ve written any Rust, the syntax will feel familiar: fn for functions, let and var for bindings, types after the name.

Back in the stadium, shaders come in three flavors:

  • Vertex shaders position the corners of your shapes
  • Fragment shaders decide the color of each pixel – the fan with the card
  • Compute shaders skip the picture and just crunch data in parallel

Here’s a small fragment shader – every pixel works out its own color from where it sits and what time it is:

struct Uniforms {
    resolution: vec2f,
    time: f32,
}

@group(0) @binding(0) var<uniform> u: Uniforms;

@fragment
fn fs(@builtin(position) pos: vec4f) -> @location(0) vec4f {
    let uv = pos.xy / u.resolution;
    let wave = 0.5 + 0.5 * sin(uv.x * 6.0 + u.time);
    return vec4f(uv.x * wave, uv.y * 0.4, wave, 1.0);
}

vec2f and vec4f are built-in vector types, @builtin(position) is the seat number, @location(0) says where the output color goes, and @group / @binding is how data from your app reaches the shader. That’s the whole mental model: one function, thousands of fans, one image.

Implementations

WebGPU Implementations across Platforms

Standardization of specs

WebGPU didn’t appear overnight. The W3C “GPU for the Web” group launched in 2017, with Apple, Google, and Mozilla each bringing their own experiments to the table. The spec reached its first Candidate Recommendation snapshot in December 2024, and the latest draft landed in September 2026. WGSL has its own spec, and a compiler on each side of the fence – Tint in Google’s Dawn, Naga in the Rust world.

Three browser vendors, three native graphics APIs, years of negotiation – and the result is one API that behaves consistently across all of them. That’s rare.

The story in web browsers

By November 2025, WebGPU was supported in all major browsers:

BrowserFirst WebGPU release
Chrome / EdgeVersion 113, May 2023
FirefoxVersion 141, July 2025 (Windows first)
SafariVersion 26, September 2025 (macOS, iOS, iPadOS, visionOS)

Under the hood, Chromium-based browsers use Google’s C++ Dawn, while Firefox uses the Rust wgpu library. Same spec, different engines – and platform coverage is still filling in, which is why fallback strategy comes up in a minute.

Option for native apps

The WebGPU API isn’t locked inside a browser. wgpu and Dawn both work natively, and the API follows a standard C header, webgpu.h, that native libraries implement. The same WebGPU model you’d use in a browser can drive a desktop or mobile app directly.

Which is exactly the door Uno Platform walks through.

Uno Platform

WebGPU with Uno Platform

7.0 support

Uno Platform 7.0 ships a new WebGPU rendering backend, joining Skia as a rendering option on Windows, Linux, macOS, Android, iOS, and WebAssembly. Drawing now goes through a backend-neutral layer underneath the compositor; the WebGPU backend is built on wgpu-native on desktop and mobile, and on the browser’s own WebGPU support in WebAssembly. Depending on the scene, we’ve measured up to a 50% improvement in frames per second. And an app that uses only WebGPU ships without SkiaSharp at all – about 6 MB less uncompressed native code in WebAssembly apps.

Honest status check: WebGPU is experimental and opt-in. SkiaSharp 4 remains the default for cross-platform rendering for Uno Platform apps.

Turning it on takes two steps: add WebGpu to your UnoFeatures, then register the backend on your host builder.

First, add the feature to your project (listing Skia alongside it keeps SkiaSharp in the app, which the fallback below needs):

<UnoFeatures>Skia;WebGpu</UnoFeatures>

Then register the backend on your host builder:

var host = UnoPlatformHostBuilder.Create()
    .App(() => new App())
    .GraphicsBackend(WebGpuBackend.CreateGraphicsProvider())
    .GraphicsBackend(SkiaBackend.CreateGraphicsProvider())
    .UseX11()
    .UseLinuxFrameBuffer()
    .UseMacOS()
    .UseWin32()
    .Build();

host.Run();

The same two GraphicsBackend calls apply on every target – for example before .UseAndroid(), .UseAppleUIKit(), or .UseWebAssembly(). Wondering why Skia is registered after WebGPU? Hold that thought – it’s the next section.

Fallback options | Support across platforms

Remember the “which device, which GPU” caveat? Each backend you register is added in order of preference. When a window is created, Uno Platform tries them in that order and uses the first one that initializes. Register WebGPU first and Skia second, and an app on a browser or device without WebGPU quietly renders with Skia instead.

Developer Check

Always register the fallback. Register WebGPU alone and the implicit Skia default is gone – on a device where WebGPU can’t initialize, startup fails.

HostWebGPU
Windows, Linux (X11), Android, iOS✅ Yes
macOS✅ Yes, unless the host renders in software
WebAssembly✅ Yes, in browsers with WebGPU support
tvOS, Linux framebuffer❌ No
Windows App SDK❌ No – this target renders with WinUI

Prefer to go all-in? List WebGpu without Skia and the app carries no SkiaSharp at all – smaller, but with no fallback renderer.

Powerful Rendering with XAML & WGSL mixed in

Swapping the renderer is nice. But here’s the part that made us sit up – you can bring your own WebGPU code into the middle of your UI.

Meet WebGpuCanvasElement: a control for drawing with your own WebGPU commands that sits in your layout like any other element – behind your text, next to your buttons, inside your Grid. It renders on the same WebGPU device as the rest of your app, and the backend draws its output with no copy. You subclass it and override three methods – Init to create pipelines and buffers, RenderOverride to encode each frame, OnDestroy to clean up.

XAML does what XAML is great at – layout, input, accessibility, data binding. WGSL does what the GPU is great at. Mix and match.

Two caveats worth knowing: the element only draws under the WebGPU backend (with any other, it reports that it’s unavailable – so plan a graceful fallback), and it speaks the Silk.NET.WebGPU API, so expect some unsafe code.

Example: Uno Calculator app with WGSL background

Let’s put it to work on something wonderfully ordinary: a calculator.

UnoWebGPU is a Material-styled Uno Platform calculator with an animated aurora drifting behind the keypad, drawn by a WGSL shader through WebGPU. One codebase, running on WebAssembly, desktop, Android, and iOS. The calculator itself is deliberately plain – immutable Calculator record, MVVM view model, Material theme. All the GPU work lives in one class, ShaderBackdrop, a WebGpuCanvasElement that sits behind the display and keys.

The shader is the fun part. There’s no vertex buffer – the vertex shader draws one oversized triangle covering the whole target, and the fragment shader does everything else. Every pixel layers three drifting color “blobs” over a base color, using a simple Gaussian falloff:

fn blob(p: vec2f, center: vec2f, radius: f32) -> f32 {
    let d = length(p - center);
    return exp(-(d * d) / (radius * radius));
}

// ... per pixel: three blobs whose centers wander with time
let b1 = blob(p, vec2f(sin(t) * 0.45, cos(t * 0.8) * 0.35 - 0.2), 0.55);

// Each palette color is a mix() between its light and dark variant
let violet = mix(vec3f(0.72, 0.62, 1.00), vec3f(0.36, 0.22, 0.78), u.dark);
color = mix(color, violet, b1 * 0.85);

A gentle domain warp makes the blobs flow like an aurora, and a soft vignette plus a touch of grain keeps banding at bay. Notice u.dark: when the user flips the app’s light/dark toggle, the view model also passes that value to the shader, so the same code swaps palettes on the fly. Buttons still click, text still scales, screen readers still work – the GPU just got a seat at the table.

And the fallback? Each platform head asks for the WebGPU backend first and Skia second. In a browser without WebGPU, the calculator works exactly the same – the backdrop simply renders nothing and the plain page background shows through. Light show politely declines.

🎬 Video

Source: github.com/samidip/UnoWebGPU

Example: Uno Particle physics around gravity wells

Now for the one that makes the GPU earn its keep.

UnoParticles is a real-time simulation of up to 2 million particles orbiting, spiraling, and slingshotting around draggable gravity wells. All of the physics runs in a WGSL compute shader, and the whole thing is driven by plain XAML data binding. It runs from one codebase on desktop and in the browser via WebAssembly.

Every particle asks the same question each frame: how hard am I being pulled, and where am I going next? Same instruction sheet, one per fan – a textbook compute problem. Here’s the heart of it, trimmed from the real shader:

// Acceleration towards a well at offset d, for the force law picked in XAML
fn pull(d : vec2f, mass : f32) -> vec2f {
    let r2 = dot(d, d) + P.softening;
    let invR = inverseSqrt(r2);
    var k : f32;
    switch P.forceLaw {
        case 1u: { k = 1.0 * invR * invR; }        // 1/r (cosmic string)
        case 2u: { k = 2.0; }                      // r (spring)
        default: { k = 0.5 * invR * invR * invR; } // 1/r² (Newton)
    }
    return d * (k * mass * P.gravity);
}

@compute @workgroup_size(256)
fn simulate(@builtin(global_invocation_id) gid : vec3u) {
    // ... for each well:
    let a = pull(well.xy - p.pos, well.z);
    acc += a + vec2f(-a.y, a.x) * P.swirl;   // tangential kick -> spiral arms
    // ... integrate velocity and position
}

Each invocation owns one particle, sums the pull of up to 8 wells, and adds a sideways “swirl” kick – rotate the acceleration 90° and straight-line infall becomes spiral arms. A negative well mass repels, so one number covers attract and repel. Particles flung off-screen respawn at random, right on the GPU, so the field never runs dry.

What makes it sing is the XAML connection. GravityParticlesCanvas extends WebGpuCanvasElement and exposes every simulation knob as a dependency property – force law, gravity, swirl, damping, trails, particle count from 16K to 2M, color palette. The side panel binds to them like any other control, and each frame the values are packed into a uniform buffer that mirrors the shader’s Params struct byte for byte. Slide the force law from 1/r² to a spring and watch two million particles change their minds mid-flight. No shader rewrite, no rebuild – just a binding.

Two design choices keep it fast. The particle buffer does double duty – the compute shader writes it, and the render pass reads that same buffer to draw, so particles never leave the GPU. And the look comes from simple tricks: a full-screen fade pass that dims the previous frame (that’s your motion trails), then instanced, additively blended sprites colored by speed.

It’s interactive too: drag a well to move it, right-click to flip attract and repel, double-tap empty space to add a well, double-tap a well to remove it. The side panel even shows the actual WGSL compute source the app is running – no curtain, nothing hidden. And like the calculator, if WebGPU isn’t available the app falls back to Skia and shows a banner explaining why.

🎬 Video

Source: github.com/samidip/UnoParticles

Wrapup

Wrapup

Why WebGPU matters

WebGPU turns the GPU from something you reach through a keyhole into something you can walk right up to. One standard. Every major browser. Native implementations beyond the browser. Graphics and compute – on Vulkan, Metal, and Direct3D 12 without writing three versions of anything. That’s not a niche feature. That’s a foundation.

Wow-worthy UI, on the GPUs your users already have

Every phone, laptop, and desktop your app lands on has a GPU sitting mostly idle while it draws a few rectangles. With the WebGPU backend, your whole UI can render through it. With WebGpuCanvasElement, you can drop custom shaders and simulations right next to your XAML – on the same device, with no copy.

Backgrounds that breathe. Particle fields that react to a finger. The kind of UI that makes someone say “wait – that’s a business app?”

Uno Platform support

Uno Platform 7.0 puts this in your hands today: a WebGPU rendering backend across Windows, Linux, macOS, Android, iOS, and WebAssembly; ordered fallback to Skia so your app runs everywhere; and WebGpuCanvasElement for your own WGSL living right in your XAML. It’s experimental and opt-in – and we’d love your feedback.

The stadium is built. The instruction sheet is yours to write. We can’t wait to see what you build – Cheers developers!

Next Steps

Next Steps

The post WebGPU Demystified For .NET Apps appeared first on Uno Platform.

Read the whole story
alvinashcraft
6 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Managing Background Tasks with Spargine TaskTracker

1 Share
TaskTracker is a component in the Spargine Dev Tool that enhances task management for noncritical background operations. It enables tracking, logging, and waiting for tasks to complete before application shutdown. The API supports dependency injection and offers various methods to register and monitor tasks, ensuring efficient handling of background processes and exceptions.
Read the whole story
alvinashcraft
6 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Private Tokens on Demand With OIDC

1 Share
Learn how you can use OpenID Connect (OIDC) to broker short-lived tokens that give your workflows and agents secure just-in-time resource access.

Read the whole story
alvinashcraft
6 hours ago
reply
Pennsylvania, USA
Share this story
Delete

React Forms Without the Tears

1 Share

I gave a version of this blog post as a lunch n’ learn at work for my team. I didn’t want to post it here at first, because I thought it was pretty basic, but one of the things I preach about blogging is that what is basic for one person may not be basic for others, so I’ve decided to go ahead and put it out there. Also, at Attentive, we are pretty committed to Formik (and Yup for validation), but they’re certainly not the only tools out there. If this post makes you wish I had talked about other options for React forms, get in touch and tell me what I missed.

Once upon a time we had plain HTML forms, and that was …. fine. Maybe even good. Hard to mess this up anyway:


<form method="POST" action="cgi-bin/process.cgi">
<input type="text" value="name">
<label for="name">WHAT is your name?</label>
<input type="text" value="quest">
<label for="quest">WHAT is your quest?</label>
<fieldset>
<legend>WHAT is your favorite color?</legend>
<input type="radio" name="favoritecolor" value="blue">
<label for="blue">Blue</label>
<input type="radio" name="favoritecolor" value="red">
<label for="red">Blue! No, red!</label>
</fieldset>
<input type="submit">Submit</input>

Then React came along and really messed everything up.

There is no world in which the below is better:

import {useState} from 'React';

export const MyForm = ()=>{
const [name, setName] = useState('');
const [quest,setQuest] = useState('');
const [favoriteColor,setFavoriteColor] = useState('blue');

 const handleRadioChange = e => {
    const { name, value } = e.target;
setFavoriteColor(value)
  };

const handleSubmit = (values)=>{
await axios.post('https://httpbin.org/post', values, {
  headers: {
    'Content-Type': 'application/json',
  },
});
}

return (
  
<form>
<input type="text" value={name} onChange={(e)=>{setName(e.target.value)}}>
<label htmlFor="name">WHAT is your name?</label>
<input type="text" value={quest} onChange={(e)=>{setQuest(e.target.value)}}>
<label htmlFor="quest">WHAT is your quest?</label>
<fieldset>
<legend>WHAT is your favorite color?</legend>
<input type="radio" name="favoritecolor" value='blue' checked={favoriteColor==='blue'} onInputChange={handleRadioChange}>
<label for="blue">Blue</label>
<input type="radio" name="favoritecolor" value='red' checked={favoriteColor==='red'} onInputChange={handleRadioChange}>
<label for="red">Blue! No, red!</label>
</fieldset>
<input type="submit" onClick={handleSubmit}>Submit</input>
</form>);
}

All this extra code doesn’t even get us anything extra! This is just the extra boilerplate we need to put a form into React. If we want custom error messages, touched/dirty handling, validation, or anything else, we have to add even more code.

There’s a ton you can do with vanilla HTML forms these days and you might argue that we don’t even need JS for most of what we want to do with them, and that’s a valid argument. But that is not the world most of us live in. If I were starting a new project from scratch I might consider ditching React, but again, let’s assume that we’re committed to JS and to React. Even if that’s the case, we don’t want to write forms like the above.

Formik makes React forms much less painful. This is the library I’m most familiar with (again, we use it at work), so that’s what this post is about, but again, it’s not the only option out there. I’ve heard positive things about Tanstack Form and React Hook Form.

Back to Formik. With Formik, we can get code that is almost as simple as the original form:


import React from 'react';
import { Formik } from 'formik';
export const MyForm = () => (
 <Formik
 initialValues={{ name: '', quest: '', favoriteColor: 'blue' }}
 onSubmit={(values, { setSubmitting }) => {
 await axios.post(values);
 setSubmitting(false);
    }
 }
 >
 {({isSubmitting}) => (
 <Form>
 <label htmlFor="name">WHAT is your name?</label>
 <Field type="text" name="name"/>
<label htmlFor="quest">WHAT is your quest?</label>
 <Field type="text" name="quest"/>
<div id="favoriteColor">WHAT is your favorite color?</div>
<label>
<Field type="radio" name="favoriteColor" value="blue" />Blue
</label>
<label>
<Field type="radio" name="favoriteColor" value="red" />
Blue! No, red!
</label>
</div>
 <button type="submit" disabled={isSubmitting}>Submit</button>
 </Form>
 )}
 );
;

This is a lot better! AND now we can do other interesting things with it.

Perhaps this is an update form rather than a form to create a new record. In that case we might want to pre-fill some of the values with the existing data from the database.


<Formik
 initialValues={{ name: existingName, quest: existingQuest, favoriteColor: existingFavoriteColor }}
 ...
 

Perhaps we want to know if the form has been changed since loading those existing values. Instead of setting onBlur handlers, we just need to:


<Formik>
<Form>
{const {dirty} = useFormikContext();}
{!dirty && <p>You need to change something!</p>}
</Form>
</Formik>

And we can do validation as well. You can write your own custom validation, but Formik plays very nicely with a validation library called Yup:

const SignupSchema = Yup.object().shape({
 firstName: Yup.string()
 .min(2, 'Too Short!')
 .max(50, 'Too Long!')
 .required('Required'),
 lastName: Yup.string()
 .min(2, 'Too Short!')
 .max(50, 'Too Long!')
 .required('Required'),
 email: Yup.string().email('Invalid email').required('Required'),
 });

(This example comes straight from Formik’s docs, but please do not, in a real world situation, make assumptions about name length like this, or believe any of these other falsehoods about names. I will come to your house and look at you very sternly.)

We can then use the schema and automatically validate the form on submission and surface errors in the UI:


export const ValidationSchemaExample = () => (
 <div>
 <h1>Signup</h1>
 <Formik
 initialValues={{
 firstName: '',
 lastName: '',
 email: '',
 }}

 validationSchema={SignupSchema}
 onSubmit={values => {
 // same shape as initial values
 //do whatever you want with the values
 }}
>
 {({ errors, touched }) => (
 <Form>
 <Field name="firstName" />
 {errors.firstName && touched.firstName ? (
 <div>{errors.firstName}</div>
 ) : null}
 <Field name="lastName" />
 {errors.lastName && touched.lastName ? (
 <div>{errors.lastName}</div>
 ) : null}
 <Field name="email" type="email" />
 {errors.email && touched.email ? <div>{errors.email}</div> : null}
 <button type="submit">Submit</button>
 </Form>
 )}
 </Formik>
 </div>
 );
 

(Please keep in mind that these examples are abstractions. One main issue you’ll run into if you copy and paste these verbatim is that hooks can only be run at the top levels of components, so this really needs to be two components, one defining the Formik context and the child component hooking into the context via the hook.)

With these tools, we can make our forms more declarative, reduce boilerplate, and honestly do some pretty neat things that save us a bit of time.

The main takeaway is not that I endorse one tool or another, although I quite like Formik. The main takeaway is: do not manage internal form state manually in React. If you find yourself writing a custom blur handler, reach for Formik.



Read the whole story
alvinashcraft
6 hours ago
reply
Pennsylvania, USA
Share this story
Delete

v2026.11.12

1 Share

OpenClaw v2026.11.12

Read the whole story
alvinashcraft
6 hours ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories