Describe the phenomenon
Begin with a natural-language request for the physical system, controls, and visual result you want to explore.
AI + WebGPU for mathematical exploration
Describe a phenomenon—from orbital mechanics and electromagnetism to fluid dynamics and quantum physics—and turn it into an interactive GPU simulation in your browser.
GPUSims handles WebGPU resources, pipelines, rendering, and boilerplate so that AI can concentrate on the mathematical model and simulation logic.
Create a schema for an N-body simulation.
From an idea to a running model
AI can generate simulation code for fields such as classical mechanics, electromagnetism, fluid dynamics, statistical physics, and quantum mechanics. GPUSims provides the structure that helps the AI produce code that can actually be compiled, executed, inspected, and improved.
Begin with a natural-language request for the physical system, controls, and visual result you want to explore.
AI creates a declarative schema and implements the mathematical logic inside an app-generated WGSL skeleton.
Execute the simulation, examine numerical and visual output, correct problems, and generate an explanatory article.
Why the architecture works
WebGPU setup is powerful but complex. Instead of asking AI to build every buffer, binding, pipeline, and renderer from scratch, GPUSims divides the work into four clear stages.
AI defines GPU resources, shader passes, user controls, and execution order in a JSON-like schema.
GPUSims converts the schema into shader skeletons with matching structs, bindings, and entry points.
AI fills in the core equations and algorithms without having to recreate the surrounding WebGPU infrastructure.
GPUSims compiles the shaders, executes the GPU pipeline, renders the result, and exposes controls and readback values.
Two ways to build
Move step by step between GPUSims and your AI chat. This workflow is transparent, editable, and especially useful for learning.
Start with one prompt. A local Python agent coordinates the AI API, Selenium, Chrome, and GPUSims to complete the development cycle.
Requires a configured local Python environment, browser automation, and AI API credentials.
Execution is only the beginning
If a schema or shader fails, copy the reported error to the AI. It can revise the schema or WGSL code and continue the iteration.
Fix this error.
Readback values can be returned from GPU memory and examined to catch mistakes that are not obvious from the animation alone.
Capture the rendered canvas and ask the AI to evaluate whether the visible behavior is consistent with the intended model.
Is this result physically plausible?
AI-assisted checks are useful for iteration, but they are not formal scientific verification. Complex or high-stakes models still require knowledgeable human review.
A visual path into difficult subjects
Abstract equations become easier to approach when you can observe and manipulate their behavior. After a simulation is complete, AI can write an article explaining the visible phenomenon, mathematical background, and code implementation.
The article is a starting point rather than the end: continue asking questions about any equation, algorithm, or unexpected result until the model becomes understandable.
Generated learning article
A virtual laboratory for AI
GPUSims gives AI more than a text-only coding task. The simulation produces compilation messages, numerical values, and images that can be fed back into an iterative loop of hypothesis, execution, observation, and correction.
Technical scope
WebGPU enables parallel computation and high-performance visualization without requiring a native desktop application.
Simulations generally use 32-bit floating-point values (f32), not the 64-bit precision common in scientific computing.
Libraries such as LAPACK are not available directly, so required algorithms must be implemented for the GPU architecture.
The same foundations—parallel execution, workgroups, buffers, and memory access—provide useful preparation for more advanced GPU computing.
Begin with one idea
Start with a familiar system, inspect what the AI creates, and use the simulation as a path into deeper mathematics and physics.
Click to copy the System Prompt, paste & run in the AI chat.
Enter the instruction to create a schema in the AI chat.
Create a schema for an N-body simulation.
Copy the schema created by the AI and paste it below.
Click to generate and copy the WGSL Skeleton, paste & run in the AI chat..
Copy the finalized WGSL code by the AI and paste it below.
Click to compile and launch your WebGPU pipeline.