DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to see how an if-else becomes arithmetic with Handwired

Follow the README example that rewrites a ternary with ReLU so both branches compute.

Short answer: Read the How It Works section and the const a = 5 example; then 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. All steps.

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

  1. Read the How It Works section and the const a = 5 example
  2. Work out above4 = Math.max(0, a - 4) - Math.max(0, a - 5) by hand for a few values of a
  3. See how above4 picks between 10 and 12 with both branches computed
  4. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer