Skip to content

Add Image Generation & Diffusion track - #1

Open
YashJayswal24 wants to merge 2 commits into
mainfrom
feat/diffusion-track
Open

Add Image Generation & Diffusion track#1
YashJayswal24 wants to merge 2 commits into
mainfrom
feat/diffusion-track

Conversation

@YashJayswal24

Copy link
Copy Markdown
Collaborator

Adds an Image Generation & Diffusion track: 3 chapters, 10 pages, 9 live simulators. Placed before the specdec track, because specdec/03-parallel-drafting already leaned on diffusion for DFlash and assumed the reader knew what it was.

Chapter Pages Simulators
1 — What Generation Asks For the task · GANs · why they broke ManifoldSlice, GANDuel, ModeCoverage
2 — Destroy It, Then Undo It hook · forward process · noise prediction · one big step MixingReversibility, ForwardNoise, ThreeTargets, StepBudget
3 — How Stable Diffusion Works latent diffusion · conditioning · guidance LatentCompress, GuidanceDial

New rendering path

lib/PixelCanvas.tsx is the repo's first canvas renderer. The site was 100% SVG/Plotly, which cannot carry a 24×24 frame (576 cells) across several panels at frame rate — that spends the whole budget in reconciliation. It renders grayscale in both themes on purpose: theme-inverting an image makes one sprite read as two different images, so only the frame is theme-aware.

Also lib/{diffusionMath,sprites,spectrum,pca,tinynn}.ts — all pure, no React imports, so they run directly under node --experimental-strip-types.

Every numeric claim was measured before the caption was written

That is the reason for the extra lib/ modules, and it repeatedly overturned the plan:

  • The step-count sweep converges at T=4, not 1000. Distance-to-nearest-real runs 0.50 / 0.063 / 0.0032 at T = 1 / 2 / 4 and then sits at 0.0032 through T=200. Growing the training set 8 → 1024 changed nothing; injecting per-call denoiser error changed nothing. The page now says so outright, and explains that real systems need more steps because their denoiser is a learned approximation — with DDIM (1000→50) and consistency models (→1–4) as the evidence.
  • A stronger GAN discriminator helps, rather than causing collapse: 6–8 modes and 9–15% off-data at 4 D-steps, versus 3–8 modes and 11–79% at 1 step. The folk story is about the 2014 minimax loss. What is reproducible is seed variance — 3 modes/79% off-data to 8 modes/11% across 8 seeds at one fixed config, with the loss curves looking the same either way. That became the chapter's thesis.
  • Reverse KL does not mode-seek from an arbitrary start. Over seven starting points, forward KL lands at μ≈0.1, σ=2.65 covering 3/3 every time, while JS and reverse KL land on whichever mode they began beside. The start position became the widget's only knob.
  • Guidance saturation artifacts do not reproduce with an exact score — distance-to-real holds at 0.003 from w=1 through w=15, while diversity does decay (13 → 8 of 16 images). The burned-out look in real systems is the learned score's approximation error, amplified.

Two controls that turned out to do nothing — a kernel-width knob and a dead Run button — were removed rather than shipped, with code comments explaining why so they aren't re-added. MILESTONES.md records all of it.

Second commit: two fixes

  • Upstream's ch03 restructure removed mean-field-trap.mdx, so the two diffusion pages citing it now point at dspark/#the-trap-a-product-of-marginals (anchor verified in the built HTML).
  • The redirect added for the old URL 404s on Pages. Astro emits the target verbatim into the meta-refresh, so /specdec/03-parallel-drafting/dspark/ without the /stable-learning base resolves to the domain root — the same trap as c005587. One-line fix; happy to drop it into its own PR if you'd rather.

Verification

  • npm run build clean, 58 pages
  • Whole-site link check: 3660/3660 internal links resolve, including the redirect
  • Both themes checked by headless screenshot; canvas widgets are the first here that don't inherit theme automatically
  • Library-level claims re-run against the actual modules, not eyeballed

🤖 Generated with Claude Code

https://claude.ai/code/session_01TCNCrkx7GQ85MV1A6b6bgU

YashJayswal24 and others added 2 commits July 29, 2026 07:35
Three chapters, ten pages, nine live simulators, placed before the specdec
track because DFlash already assumed the reader knew what diffusion was.

Ch1 the task, GANs and why they broke; ch2 the forward process, noise
prediction and the one-step blur; ch3 latent diffusion, conditioning and
guidance.

New rendering path: lib/PixelCanvas.tsx, the repo's first canvas renderer —
576 React <rect>s per frame across several panels spends the whole frame
budget in reconciliation. Plus lib/{diffusionMath,sprites,spectrum,pca,
tinynn}.ts, all pure and runnable under node --experimental-strip-types.

Every numeric claim in the prose was measured by running those modules
before the caption was written, which overturned several planned narratives:
the step-count sweep converges at T=4 rather than climbing to 1000; a
stronger GAN discriminator tightens outcomes rather than causing collapse;
reverse KL does not mode-seek from an arbitrary start. Two controls that
turned out to do nothing (a kernel-width knob, a dead Run button) were
removed rather than shipped. MILESTONES.md records what was measured.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… base

The specdec ch03 restructure removed mean-field-trap.mdx and folded it into
dspark.mdx, so the two diffusion pages that cite it now point at
dspark/#the-trap-a-product-of-marginals instead.

Also fixes the redirect added for the old URL: Astro emits the target
verbatim into the meta-refresh, so an absolute path without the
/stable-learning base resolves to the domain root and 404s on Pages — the
same trap as c005587. Caught by the whole-site link check, which now passes
3660/3660 including the redirect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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