Skip to content

Compare bounded decoding against libheif in CI - #22

Closed
laurens-pilot wants to merge 1 commit into
mainfrom
ci/bounded-libheif-oracle
Closed

laurens-pilot wants to merge 1 commit into
mainfrom
ci/bounded-libheif-oracle

Conversation

@laurens-pilot

Copy link
Copy Markdown
Owner

decode_bounded was never compared with libheif in CI, so a bug that only the bounded path has could ship bad pixels unnoticed. A new step in the verify job decodes every file in the CI corpora with decode_bounded, at max side 6000 and 97 with Ente's 512 MiB budget. It compares each result with the strict libheif oracle after applying Exif orientation, sRGB conversion and an area average, within ±1 per sample.

The step also fails on:

  • crashes and timeouts;
  • an allocation past the budget;
  • unexpected errors;
  • an oracle crash;
  • a successful decode of a file libheif rejects.

Generated fixtures add odd-size crops, rotations, mirrors and Display P3/BT.2020 nclx images, and a few known-good files must pass.

The first run found a real divergence. libheif converts 4:2:0 chroma to 4:4:4 before a clap crop with an odd origin, and before rotating or mirroring an image with an odd width or height. heic-decoder keeps nearest-neighbour chroma there, and decode_bounded differed from libheif by up to 191 on such files. It now refuses those transforms, judged step by step the way libheif decides. Across the CI corpora this refuses only synthetic test files. The regular decoder still differs on these cases; matching libheif there is a separate follow-up.

Locally (macOS, libheif at the CI pin), the step takes about 30 s: 102 comparisons pass, 402 decodes are refused as unsupported, and nothing fails. It has not run on Linux yet.

CI now decodes every corpus file with decode_bounded at max side 6000 and
97 and compares the result with the strict libheif oracle, after applying
Exif orientation, sRGB conversion and an area average. Generated fixtures
cover odd-size crops, rotations, mirrors and nclx colour.

decode_bounded now refuses clap crops, rotations and mirrors for which
libheif converts 4:2:0 chroma to 4:4:4 first, so every image it decodes
matches libheif.
@laurens-pilot

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T11:32:52.878231Z 8e18810 Manual request
🔒 Security Review ✅ Completed 2026-11-06T11:33:34.609591Z 8e18810 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 8e18810618

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8e18810618

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@laurens-pilot

Copy link
Copy Markdown
Owner Author

Superseded by ente#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.

2 participants