Skip to content

rawspeed: add pin-reproduction and upstream-split tooling - #1

Draft
MaykThewessen wants to merge 1 commit into
masterfrom
claude/ljpeg-predictor-modes-q27nsa
Draft

rawspeed: add pin-reproduction and upstream-split tooling#1
MaykThewessen wants to merge 1 commit into
masterfrom
claude/ljpeg-predictor-modes-q27nsa

Conversation

@MaykThewessen

Copy link
Copy Markdown
Owner

Why

The rawspeed submodule is pinned to 2c3dfc5779, which carries the LJpeg predictor-mode work from darktable-org/rawspeed#963 plus a local JPEG XL (DNG 1.7) decompressor.

That commit is not reachable from any branch of darktable-org/rawspeed, so a fresh clone of this fork cannot run git submodule update --init src/external/rawspeed. Commit e89eb1c noted the problem but left no way to recover from it.

Separately, darktable-org#963 is stalled upstream: the code has been stable for over a month and the only red CI is pre-existing infra noise, but the maintainer is focused on a Rust port and is not currently merging features. Splitting it into smaller reviews is the most actionable path.

This PR adds tools/rawspeed_proraw/ to address both. Nothing here is part of the darktable build; these are maintenance aids.

What changed

pin/: reproduce the pinned tree from public refs only

A 10-patch series plus rebuild_pin.sh, which rebuilds from upstream refs/heads/stable (4c511d61, published) plus the series.

  • Verified: produces tree 099b577e, byte-for-byte identical to the pinned commit's tree, and git diff against the pin is empty.
  • The script self-verifies and fails loudly if the tree hash does not match.
  • The rebuilt commit SHA differs (committer identity and timestamps), so the README documents the real fix: push the rebuilt commit to a fork you control and repoint the submodule. That is a step only you can take, and it is the one thing that makes --init work for a stranger.

upstream_split/: darktable-org#963 carved into five independently reviewable series

Each applies to upstream develop (c835b05a) with zero conflicts, and each compiles and links on its own. Original authorship (Philipp Lutz) is preserved in every patch.

Series Content Commits
01_ljpeg_predictor_modes Predictor modes 2 to 7, inverted tile reshape, follow-up cleanups 7
02_dng_unique_camera_model UniqueCameraModel Exif tag for DNG 1
03_dng_12bit_jpeg_errmsg Clearer error for 12-bit lossy-JPEG DNGs 1
04_analyzer_hardening Analyzer/sanitizer/fuzzer fixes with no LJpeg content 1
05_jpegxl_dng17 JPEG XL decompressor (DNG 1.7, compression 52546) 1

Series 02 to 04 are single small commits. Landing those first shrinks darktable-org#963 to the part that genuinely needs decoder expertise. Series 05 is not part of darktable-org#963; it is separate local work listed because it shares the pin.

One trap worth flagging upstream

Upstream cf87137 ("Address clang-tidy, sanitizer and fuzzer findings") looks self-contained, but one hunk validates a predictorMode member that only the predictor-mode work introduces. LJpegDecompressor is final and does not inherit AbstractLJpegDecoder, so that member does not exist on develop.

It cherry-picks onto develop without conflict and then fails to compile:

LJpegDecompressor.cpp:118:28: error: 'predictorMode' was not declared in this scope

So a naive commit-by-commit split of darktable-org#963 looks clean and is broken. This split folds that hunk into the predictor series and keeps the other three hunks, which touch no LJpeg code, in 04_analyzer_hardening.

Verification

Configured with CMake + Ninja, Release, testing/benchmarking/tools/fuzzers off, built to completion:

Series Result
01 builds, links, 0 errors
02 builds, 0 errors
03 builds, 0 errors
04 builds, 0 errors
05 builds, 0 errors, with -DWITH_JPEGXL=ON

Also confirmed the negative case above actually fails to compile, rather than assuming it.

Series 05 builds against libjxl 0.7.0, so JPEG XL does not require the 0.11.2 recorded in the earlier bump notes.

Not covered: no raw sample corpus was decoded here, so this verifies compilation and separability, not decode correctness. Decode correctness for predictor modes 1 to 7 and for ProRAW was checked separately on real iPhone 12 / 15 Pro Max files and reported in the darktable-org#963 thread.

Note

The submodule pin itself is unchanged by this PR.


🤖 Generated with Claude Code

https://claude.ai/code/session_01NUwVtz47jcvsuPy17tLUQu


Generated by Claude Code

The rawspeed submodule is pinned to 2c3dfc5779, which carries the LJpeg
predictor-mode work from darktable-org/rawspeed#963 plus a local JPEG XL
(DNG 1.7) decompressor. That commit is not reachable from any branch of
darktable-org/rawspeed, so a fresh clone of this fork cannot initialise the
submodule. Commit e89eb1c noted the problem but left no way to recover.

Add tools/rawspeed_proraw/ with two aids, neither of which is part of the
darktable build:

pin/
  A 10-patch series plus rebuild_pin.sh that reconstructs the pinned tree
  from public refs only: upstream refs/heads/stable (4c511d61) plus the
  series. Verified to produce tree 099b577e, byte-for-byte identical to the
  pinned commit's tree; the script fails loudly if it does not. The rebuilt
  commit SHA differs, since committer identity and timestamps differ, so the
  README also documents pushing to a fork and repointing the submodule as
  the real fix.

upstream_split/
  The same work split into five series that each apply to upstream develop
  (c835b05a) with zero conflicts and each compile and link on their own:
  predictor modes, the UniqueCameraModel DNG tag, the 12-bit lossy-JPEG
  error message, the non-LJpeg analyzer fixes, and JPEG XL. Original
  authorship is preserved in every patch.

  Records one trap found while splitting: upstream cf87137 cherry-picks onto
  develop without conflict but does not compile there, because one hunk
  validates a predictorMode member that only the predictor-mode work adds
  ("'predictorMode' was not declared in this scope"). A naive
  commit-by-commit split looks clean and is broken, so that hunk is folded
  into the predictor series.

Series 05 builds against libjxl 0.7.0, so JPEG XL does not require the
0.11.2 recorded in the earlier bump notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUwVtz47jcvsuPy17tLUQu
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