Skip to content

Pixel Peeper: a blind compression eye exam at /pixel-peeper - #59

Merged
oddharsh merged 1 commit into
mainfrom
perf/defer-luna-homepage
Jul 22, 2026
Merged

oddharsh merged 1 commit into
mainfrom
perf/defer-luna-homepage

Conversation

@oddharsh

@oddharsh oddharsh commented Jul 22, 2026 •

Copy link
Copy Markdown
Owner

What this adds

Pixel Peeper, a blind vision test for image compression, at /pixel-peeper. Each call shows the same photo squeezed two or three ways and you pick the best on instinct. The prompt never says what changed, so you can't pattern-match on "the color one." Every tile is a real offline encode (zenc / jpegli / mozjpeg / sips; honest 4:2:2 vs 4:2:0 on the 4:2:2-native Fuji files), scored by ssimulacra2 and butteraugli.

The payoff: those two metrics are rival models of human vision that disagree, so the results screen places your eye on the axis between them and shows which one you side with. It closes with an understanding check (predict-then-check quiz, misconception distractors), matching the /garage convention.

Wiring

  • holding/pixel-peeper/: a self-contained XP-window shell + a metadata manifest.json + 44 content-hashed tile files. Pure static, so it rides the default env.ASSETS fallthrough with no worker or run_worker_first change; the clean slashless /pixel-peeper URL comes from html_handling: drop-trailing-slash. The shell uses absolute /pixel-peeper/ paths (relative would break at the slashless URL) and lazy-loads tiles per call, so first paint is a ~28KB shell + ~9KB manifest, not the ~1.2MB of encodes.
  • _headers: shell + manifest revalidate like the garage pages (a deploy purges the edge); the content-hashed tiles are immutable-1y like /i/.
  • garage/index.html + sitemap.xml: a shelf entry (status: prototype) and a sitemap line for discoverability.

Verified

node build.mjs passes its invariant tripwires and stages the folder byte-identical (the minifier only touches holding/index.html + the six named scripts). Served the real .build/ tree and confirmed the game boots, fetches its manifest over the absolute path, lazy-loads tiles per call, and the results + quiz render with no console errors.

Claim card

  • My model: a new static page at /pixel-peeper (self-contained game shell + metadata manifest + content-hashed tiles) plus discoverability wiring (garage shelf, sitemap) and cache headers. No change to any existing route's behavior.
  • Mechanism: static-by-default routing. Any path absent from wrangler run_worker_first and from the index.js ROUTES/PREFIX tables falls through to env.ASSETS.fetch. /pixel-peeper is in neither table, so it serves statically; html_handling: drop-trailing-slash maps the slashless URL to the folder's index.html. Absolute /pixel-peeper/ asset paths make the shell's manifest + tile fetches resolve at that slashless URL. _headers gives content-hashed tiles immutable-1y and the shell/manifest a revalidate contract.
  • Falsifier: any of these would break it: a collision with an existing worker route; relative asset paths (would 404 the manifest at the slashless URL); build.mjs minifying or renaming the shell; the new folder perturbing an existing route; or the build invariant (every index.js dispatch key covered by run_worker_first) tripping.
  • Evidence: node build.mjs exits 0 with "invariants ok: 56 routes mirrored"; diff -q shows the staged index.html byte-identical to source; serving the real .build/holding tree, the game boots, fetches /pixel-peeper/manifest.json over the absolute path, lazy-loads exactly the current + next call's tiles (network-verified), and the results + quiz render with zero console errors; git merge-tree against main is conflict-free; production is untouched (live /pixel-peeper 404s, homepage still serves the perf(cache): content-hash nav.js + luna.css into immutable /a/ URLs #56 /a/ hashed nav.js, /updates.json on v160).
  • Residual uncertainty: the slashless /pixel-peeper resolution and _headers cache semantics are Workers-platform behaviors I confirmed by config + the existing /garage, /lwe, /i/ conventions, not by a live wrangler dev hit against this exact config. Now a single commit rebased onto current main (on top of Guard CLS (keep luna defer) + fix dead Permissions-Policy token #60). The OG live-demo card is deferred because its tooling lives on main, not this branch.

Rebase note

Rebased onto current main, so this is now a single commit. Two homepage commits that once rode this branch were dropped as redundant once they landed on main independently: the luna-defer (#58) and the shell/masonry CLS guard (#60). I verified main already carries all six #axp-* inline rules from the CLS work before dropping it, so nothing is lost. That also cleared the merge conflict, since this branch no longer touches holding/index.html at all.

Net change vs main is 408 insertions, 0 deletions, entirely the Pixel Peeper feature plus its cache rules, garage entry, and sitemap line. node build.mjs passes its invariants on the rebased tree. The OG live-demo card is deferred; it can be baked from production after merge.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh 99ff1b1 Jul 22 2026, 04:02 AM

@github-actions

Copy link
Copy Markdown
Contributor

Understanding-first review

This is a prompt, not a score or merge gate. Before approving, reconstruct the change:

  • My model: What do I think this PR does?
  • Mechanism: What path or invariant makes that behavior true?
  • Falsifier: What would prove my model wrong?
  • Evidence: What test, trace, dry-run, or live check did I inspect?
  • Residual uncertainty: What remains unproven?

For docs and dependency changes, a compact answer is enough. For behavior or production changes, include the causal path and one concrete counterexample. The author’s claim card belongs in the PR description; this prompt is for the reviewer’s independent reconstruction.

See UNDERSTANDING-REVIEW.md.

@oddharsh

Copy link
Copy Markdown
Owner Author

Added an author claim card to the PR description (model / mechanism / falsifier / evidence / residual uncertainty) per the understanding-first review. Also verified this build did not touch production: live /pixel-peeper 404s, the homepage still serves the #56 /a/ content-hashed nav.js, and /updates.json reports v160, so the Cloudflare status was a PR build, not a promotion.

🤖 Addressed by Claude Code

@oddharsh
oddharsh force-pushed the perf/defer-luna-homepage branch from d1e958a to e53041d Compare July 22, 2026 02:33
…el-peeper

A vision test for image compression, ismy.blue-style: each call shows the same
photo squeezed two or three ways and you pick the best on instinct, so the test
never primes you on what to look for. Every tile is a real offline encode
(zenc / jpegli / mozjpeg / sips; honest 4:2:2 vs 4:2:0 on the 4:2:2-native Fuji
files), scored by ssimulacra2 and butteraugli. The payoff is a metric-alignment
read: the two metrics are rival models of human vision that disagree, and the
end shows which one your eye sides with. Closes with an understanding check.

Wiring:
- holding/pixel-peeper/: a self-contained XP-window shell + metadata manifest +
  44 content-hashed tile files. Pure static, so it rides the default env.ASSETS
  fallthrough with no worker or run_worker_first change; the clean /pixel-peeper
  URL comes from html_handling drop-trailing-slash. The shell uses absolute
  /pixel-peeper/ paths (relative would break at the slashless URL) and lazy-loads
  tiles per call, so first paint is a ~28KB shell + 9KB manifest, not the ~1.2MB
  of encodes.
- _headers: shell + manifest revalidate like the garage pages; the
  content-hashed tiles are immutable-1y like /i/.
- garage/index.html + sitemap.xml: a shelf entry and a sitemap line.

Verified: node build.mjs passes its invariants and stages the folder
byte-identical, and the game boots + lazy-loads from the served .build tree with
no console errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oddharsh
oddharsh force-pushed the perf/defer-luna-homepage branch from e53041d to 99ff1b1 Compare July 22, 2026 04:02
@oddharsh
oddharsh merged commit 049622a into main Jul 22, 2026
4 checks passed
@oddharsh
oddharsh deleted the perf/defer-luna-homepage branch July 22, 2026 13:34
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