Who it is forA developer who wants to understand the core trick before reading the code.
The problemThe idea of code as weights is abstract without a worked example.
The outcomeA clear picture of how conditions become differentiable math.
What you need first
- Bun to run the demos locally
- A browser for the live demos; WebGPU is optional
Steps
- Read the How It Works section and the const a = 5 example
- Work out above4 = Math.max(0, a - 4) - Math.max(0, a - 5) by hand for a few values of a
- See how above4 picks between 10 and 12 with both branches computed
- Open src/ and look for where these primitives are collected into one matmul
Prompt for your agent
Explain the Handwired How It Works example step by step with a few values of a, then find in src/ where such programs are collected into matmul and reglu.
Caveat.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for chenglou/handwired and "See how an if-else becomes arithmetic"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer