Skip to content

Add SVG visualizations to 11 challenge descriptions#209

Merged
kunal-mansukhani merged 3 commits intomainfrom
kunal/add-visualizations
Mar 7, 2026
Merged

Add SVG visualizations to 11 challenge descriptions#209
kunal-mansukhani merged 3 commits intomainfrom
kunal/add-visualizations

Conversation

@kunal-mansukhani
Copy link
Contributor

Summary

  • Adds inline SVG diagrams to 11 challenge HTML files where visualization significantly aids understanding
  • Uses a consistent dark theme (#222 background, #ccc text, blue/green accent colors) matching the existing GPT-2 block visualization
  • All SVGs are static, compact, and placed after the problem description paragraph

Challenges updated

Challenge Visualization
1D Convolution Kernel sliding over input array with dot product computation
2D Convolution Kernel overlay on 4×4 grid with element-wise multiply-add breakdown
2D Max Pooling Color-coded 2×2 pool regions with max values extracted to output
Matrix Transpose Color-coded row→column movement with curved dashed arrows
Prefix Sum Input→output with accumulation arrows showing growing dependency
Reduction Binary tree reduction: 8 values → 4 → 2 → 1 final sum
Causal Attention 6×6 triangular attend/masked grid with checkmarks and -∞ symbols
Sliding Window Attention 8×8 banded attention pattern with window_size=2
BFS Shortest Path 5×5 grid with obstacles, start/end cells, and numbered shortest path
Jacobi Stencil 2D 5-point stencil with labeled neighbors and arrows to center cell
Interleave Two input arrays with crossing arrows to alternating output positions

Test plan

  • Verify SVGs render correctly in the browser on the challenge pages
  • Check that no existing content was altered (only insertions)
  • Confirm dark theme consistency across all 11 visualizations

🤖 Generated with Claude Code

Add inline SVG diagrams to challenge.html files where visual
explanation significantly aids understanding. Each uses a consistent
dark theme matching the existing GPT-2 block visualization.

Challenges updated:
- 1D Convolution: kernel sliding over input with dot product
- 2D Convolution: kernel overlay on grid with computation breakdown
- 2D Max Pooling: color-coded pool regions with max extraction
- Matrix Transpose: color-coded row→column movement with arrows
- Prefix Sum: accumulation arrows showing growing dependency
- Reduction: binary tree reduction from 8 values to final sum
- Causal Attention: triangular attend/masked grid with checkmarks
- Sliding Window Attention: banded attention pattern (window=2)
- BFS Shortest Path: grid with obstacles and numbered path
- Jacobi Stencil 2D: 5-point stencil with neighbor arrows
- Interleave: two arrays merging into alternating output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kunal-mansukhani and others added 2 commits March 6, 2026 20:32
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kunal-mansukhani kunal-mansukhani merged commit 5e8b153 into main Mar 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant