Skip to content

feat(photos): zensim-probe sets zensim A beside ssimulacra2 and butteraugli - #1332

Draft
oddharsh wants to merge 10 commits into
mainfrom
claude/zensim-benchmark-comparison-fe0a12
Draft

oddharsh wants to merge 10 commits into
mainfrom
claude/zensim-benchmark-comparison-fe0a12

Conversation

@oddharsh

@oddharsh oddharsh commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Can zensim stand in for the two libjxl metrics the photo tools gate on? This adds a measurement-only probe that scores the same pixels with all of them and replays the two decisions they make: export-for-instagram.sh's quality search and hif-archive.ts's JPEG XL distance. The answer is still no for the archive (for a new reason, since profile A bisects cleanly where B couldn't), and still not worth it for the export.

Moved to the new imazen/zensim (2026-11-09)
This reruns the probe now that zensim has adopted profile A (2026-11-04). On 2026-10-28 the old imazen/zensim was renamed imazen/zensimx (the research repo), and a new imazen/zensim restarted the crate from 0.2.7, so the old pin, 96c3c9b, stopped resolving.

The scorer now pins the new repo at 6060039, whose only profile is A (zensim-a, the 2026-11-03 bake). Its dependencies all come from crates.io now.

The archive mode had also stopped loading, because #1552 removed hif-archive.ts's ARGS when the archive moved to jixel-enc. It now encodes with jixel-enc and scores the 8-bit djxl decodes production scores, baseline included.

What's added

  • tools/photos/zensim-score/: a Rust scorer linking zensim 0.2.7 and zensim 0.3.0 profile A (pinned by rev, since 0.3.0 is unreleased) at 8 or 16 bits. It's built on demand like zenc, declared in config/tools.json, and has no dependabot lane, because moving a pin is a rerun.

  • tools/photos/zensim-probe.ts: three modes.

    • ladder covers 31 photos with 28 encodes each at 1080 px.
    • archive replays hif-archive.ts's own bisection, imported, at 40 MP with jixel-enc, with an 8-bit control.
    • speed times both scorers.

    Findings and the instrument traps live in its header.

  • config/derivations.json, docs/MAINTENANCE.md and .gitignore entries.

Findings, 2026-11-09 (profile A; B's 2026-11-02 numbers in brackets)

  • Ranking: A disagrees with ssimulacra2 on 3.8% of 808 near-equal-bytes cross-codec calls [B 4.2%]. For scale, butteraugli 3-norm and ssimulacra2 disagree on 5.8%.
  • Instagram decision: A picks ssimulacra2's q on 10 of 15 test photos and lands within one step on all 15 [B 9 of 15]. Its fitted threshold, 83.50, sits half a point from ssimulacra2's own 84 [B 78.95].
  • Archive decision, 20 HIFs: A picks libjxl's distance on 3 of 20 (4 looser, 12 stricter), and its picks clear libjxl's bar on 15 of 20. Its score rises with distance on 3 of 385 steps (worst +0.01), where B rose on 18 of 219 (worst +1.23). At A's picks the archive totals 379.2 MB against 368.7 MB at libjxl's (+2.8%).
  • Speed at 40 MP: 2.5 s and 2.2 GB on all cores, 9.9 s on one, against 5.2 s for ssimulacra2 and 16.7 s for butteraugli_main. That's about 2.5x slower than B was [1.0 s / 2.9 s].

zensim's approx_* helpers are still broken on bake-scored profiles, and worse on A: approx_ssim2 misses ssimulacra2 by 171 points on average (r = -0.62). imazen/zensim#4 tracks the fix; imazen/zensimx#69 didn't port.

Verified

  • The libjxl and 0.2.7 ladder rows reproduce the 2026-11-02 run to the third decimal, so every change in zensim's column is zensim's.
  • lint, typecheck, format:check, pages:check and derive:check pass, as do the 14 contract tests that read config/tools.json or config/derivations.json (139 of 139).
  • The archive run used a locally patched jixel-enc, because main's doesn't build against png 0.18. fix(photos): jixel-enc builds against png 0.18 #1618 lands that same 2-line fix.
  • Nothing in the photo pipeline or the build calls any of this.

…ugli

A measurement-only probe asking whether zensim could stand in for the two
libjxl metrics the photo tools gate on. It scores the same pixels with all of
them and replays the two decisions they make: the Instagram export's quality
search and hif-archive.ts's JPEG XL distance.

- tools/photos/zensim-score/: a Rust scorer linking zensim 0.2.7 and zensim
  0.3.0 profile B (pinned by rev; 0.3.0 is unpublished) at 8 or 16 bits.
  Built on demand, like zenc. No dependabot lane: moving a pin is a rerun.
- tools/photos/zensim-probe.ts: `ladder` (31 photos x 28 encodes at 1080px),
  `archive` (hif-archive.ts's own bisection, imported, at 40 MP and 16 bits,
  with an 8-bit control) and `speed`.

Ladder findings: zensim ranks like ssimulacra2 at least as well as butteraugli
does (Spearman 0.967-0.992 vs 0.979) and picks the Instagram q as often.
zensim runs 5x to 16x faster than the libjxl tools at 40 MP, with 1.5 GB peak
against 7 to 9 GB. The archive verdict is preliminary at 4 of 20 frames.

The ported probe reproduces the scratch run it came from exactly: 56 of 56
rows on two photos, every metric.
The full run replaces the 4-frame preliminary note. zensim B picks
libjxl's cjxl distance on 4 of 20 HIFs (9 looser, 7 stricter), and its
picks clear libjxl's both-metric bar on 11. Its score improves as distance
worsens on 18 of 219 steps, where ssimulacra2 never does, so it cannot
drive hif-archive.ts's bisection.
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Wire-size diff vs merge base

ec3aede5e183022840ec77a7d4edb8829f3089a7 → ac5410541616e4aab46f16ead98889516f160907

Brotli q11, the quality the edge serves. Every number here is deterministic:
an unchanged file produces no row. Advisory — this check fails on nothing.

Client assets

No change. 40 files, 245.02 KiB Brotli total.

Pages

No change. 77 files, 721.07 KiB Brotli total.

Worker bundle

No change. 299.54 KiB gzip.

Dictionary transport

Family dictionary acquisition: no change, 14.50 KiB q11.

pd/: no change. 403 deltas, 536.46 KiB total.

Head tags vs merge base

No change. 77 documents, every title, description, canonical, robots, og:*, twitter:*, alternate, JSON-LD type and oracle status identical.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh 514fdb5 Commit Preview URL

Branch Preview URL
Nov 13 2026, 03:55 AM

@lilith

lilith commented Oct 14, 2026

Copy link
Copy Markdown

Give zensim a few weeks, it's evolving super rapidly and lacking a key training data source right now. I'm scaling up my home data center to process the millions of files needed for the synthetic training I'm doing.

…rk-comparison-fe0a12

# Conflicts:
#	.gitignore
#	docs/MAINTENANCE.md
@oddharsh

Copy link
Copy Markdown
Owner Author

@lilith will do, thanks for flagging!!

@oddharsh
oddharsh marked this pull request as draft October 14, 2026 21:32
oddharsh and others added 3 commits October 14, 2026 15:53
…rk-comparison-fe0a12

# Conflicts:
#	config/derivations.json
#	config/tools.json
validate failed on format:check: zensim-probe.ts predated `bun fmt` on
main. The full contract suite also caught `avifdec -d 8` in the ladder,
which truncates a 10-bit decode (gotcha 76); it now decodes through
avifToPng8, as gen-pixel-peeper.ts does.

The ladder was rerun with the exact decode (2026-11-02) and the header
carries the new numbers. aom 3.15.3 and zenc (#1511) had moved too, so
not every shift is the decode. The verdicts hold: zensim disagrees with
ssimulacra2 on 3.7-4.2% of cross-codec calls, butteraugli on 5.8%.
@oddharsh

oddharsh commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Closing: the probe answered its question (zensim can't stand in for the archive gate, and isn't worth it for the export), and #1523 has since moved scoring to photo-metrics. The numbers stay here for when zensim's training settles.

@oddharsh oddharsh closed this Nov 8, 2026
The scorer pinned imazen/zensim at 96c3c9b, which stopped resolving on
2026-10-28 when that repo was renamed imazen/zensimx and a new
imazen/zensim restarted the crate from 0.2.7. Repin to its 6060039,
whose only profile is A (zensim-a, the 2026-11-03 bake); its
dependencies all come from crates.io now.

The archive mode also stopped loading: #1552 removed hif-archive.ts's
ARGS when the archive moved to jixel-enc. It now encodes with jixel-enc
and scores the 8-bit djxl decodes production scores, baseline included.
Ladder, speed and the 20-HIF archive replay rerun on 2026-11-09 against imazen/zensim 6060039. A bisects cleanly (3 of 385 steps rise, worst +0.01) where B rose on 18 of 219, but it still picks differently from libjxl on 17 of 20 frames, leaning strict, for +2.8% bytes, and runs about 2.5x slower than B.
@oddharsh oddharsh reopened this Nov 9, 2026
@oddharsh oddharsh changed the title feat(photos): zensim-probe sets zensim beside ssimulacra2 and butteraugli feat(photos): zensim-probe sets zensim A beside ssimulacra2 and butteraugli Nov 9, 2026

This branch has not been deployed

No deployments
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.

2 participants