Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
wanikhawar
left a comment
There was a problem hiding this comment.
Conflicts with main, please rebase. The change itself reads correctly.
|
Needs a rebase and a port: |
|
Thanks for the review. I’m checking the current selection path and the overlap with #5019, #5000 and #3972 before porting this change. The existing measurements were reused diagnostics, so I won’t treat them as independent validation. If this still addresses a separate gap, I’ll update it against current main and add held-out evidence, including sparse-colour scenes where the pooled profile should help. If the change is already covered or superseded, I’ll close this PR with the relevant links. |
|
The port still addresses a separate gap on current main; #5019, #5000, #3972 and #4975 do not replace the accepted-profile comparison. I am keeping this PR as a draft because the revised approach has not passed photographic validation. The local port has not been pushed. The first fresh 32-photo evaluation failed a frozen sparse-colour criterion. I then froze one conservative revision: retain the pooled profile unless the per-photo proxy MSE improves by more than 2%. This is an engineering margin, not a statistical guarantee. There was no threshold sweep, profile retraining or post-score exclusion. The second frozen evaluation used 23 unseen originals after face and near-duplicate screening: 14 A6000 photos from 14 capture occasions and 9 A7CR photos from 3 shared occasions. A7CR is file-unseen, not occasion-independent. The profile bytes were unchanged. All 46 fresh-process CPU exports completed with unchanged original hashes; geometry was reviewed before scoring.
The means improved, but the frozen criteria failed: an A6000 flower worsened by 0.7145 on its 2,549-pixel colour mask and 2.3011 on its 12-pixel subject mask; an A7CR image worsened by 5.5233 on its 24-pixel colour mask. These masks were defined from the reference before exports and retain their measured limitations. Highlight and combined black-or-white endpoint criteria passed where evaluable; 3 colour masks and 8 highlight masks had insufficient pixels for evaluation. This is camera-JPEG appearance validation at 200 px after 1200 px rendering, not calibrated colour accuracy or full-resolution detail validation. The original regression fails against unchanged main. The local port passes all 2,073 engine unit tests (9 ignored), including 128 camera-preview tests (1 ignored), strict engine Clippy and the engine WebAssembly check. The full local CI attempt stopped at 19 UI-test I have stopped threshold tuning and preserved both evaluations. The next step is design only, addressing the small-subject regressions as well as the scoring split's overlap with chroma training; a shared withheld pixel partition alone would not establish better final renders. No private originals, references, paths or capture dates are included here. |
Update: this PR is a draft. The local port to current main failed fresh sparse-colour/small-subject validation and has not been pushed. See the latest validation reply; earlier CI and photo results below describe the original published head, not a validated current-main fix.
Problem
An accepted pooled camera profile can produce a worse starting look than the photo's own accepted colour fit. The ordered search stops at the first profile that passes the neutral-fallback gates, without comparing it with the per-photo alternative. A Sony A6000 foliage diagnostic reproduced this: both fits used the same sensor/reference samples, but the profile had higher gamma-domain fitting error and worse rendered camera-JPEG appearance.
Changes
The PR contains only
crates/engine/src/camera_preview.rs,crates/engine/src/media.rsanddocs/camera-preview-colour.md. It adds no dependencies or public API. It does not change RAW decoding, profile bytes, proxy resolution, acceptance thresholds or clipping policy, and does not bundle the experimental A6000 profile.Validation
Fresh full local CI passed on upstream base
c66014e65f019264f982b7a720e5a7d9df9ab408plus the exact three-file patch submitted here, with no temporary workaround:All eight stages passed: formatting, strict workspace Clippy, HEIF, workspace tests, parity, dependency layers, asset attribution and WebAssembly. The run took 46m 01s, including clean-checkout rebuilds. The harness reported 4,652 passing test executions, 0 failed and 40 ignored, including all 82 camera-preview tests. CI additionally recorded 169 availability skips: 137 corpus, 24 fonts and 8 model tests. The checkout had 0 of 451 pinned RAWs and no craft-fonts. The pipeline GPU was Apple M2 through Metal, using Rust 1.97.1 on macOS/aarch64. Existing WebAssembly warnings in unchanged code did not fail the checks. These are local results; no GitHub-hosted CI result is claimed.
The synthetic coverage includes a biased profile that still passes the existing gates, a better profile when both fits pass, and sparse-colour scenes that need a profile. The accepted-look tests cover the original, successful unclipped-refit, failed-refit and unclipped-only search paths.
Earlier photographic diagnostics used the identical Rust source files and runtime base, before rebasing this focused patch onto the current README-only upstream update. All 100 fresh-process CPU exports completed: 50 originals, each with the experimental profile directory enabled and disabled. All 50 original hashes and the experiment's profile hash remained unchanged. The 25 A6000 exports with the trial profile disabled stayed pixel-identical to the pre-change baseline. These measurements are separate from the fresh CI run above. The same source-identical binary also completed a 1600×1000 headless demo snapshot in 3.15 seconds; the resulting app view was visually inspected.
Mean CIE76 against embedded camera JPEGs, lower is closer:
Five of seven challenges return to their per-photo baselines; the foliage pixels match that baseline exactly. Two challenge regressions remain, at +0.7274 and +0.3213 relative to the per-photo baseline. The stairwell gives up the trial profile's benefit (8.7166 to 9.0716); the night-city result retains its improvement (4.9562 baseline to 4.8147). Five training images also lose small trial-profile improvements, +0.0392 to +0.1886.
The guard also affects bundled profiles. Across 25 A7CR controls, candidate-directory and empty-directory outputs remain identical to each other, but 14 photos change relative to the old algorithm: 12 improve and 2 worsen. The other 11 remain unchanged. Mean error changes from 2.8896 to 2.5579; the two regressions are +0.1763 and +0.6384, with the latter about 1 L* darker on average.
These are reused, same-photographer appearance diagnostics, not an untouched holdout or calibrated colour-accuracy result. Comparisons use aspect-preserving BOX reduction to 200 px, a centered common intersection, central 80% ROI and reference-defined clipping masks; A7CR orientation/framing was reviewed before scoring with no post-score exclusions. They do not validate full-resolution detail or all cameras.
This is a selection guard, not a fix for every fitting-proxy/full-render difference. Nonlinear colour/tone operations occur at different resolutions and in different orders, and the gamma fitting objective differs from final Lab error. The legacy colour scoring split can overlap broader chroma training, so it is not independent final validation. Additional per-photo fitting is bounded but has not had a controlled performance benchmark. The trial profile still fails its original promotion criteria and remains unbundled.
Test data
The regression tests generate their own sensor/reference samples and need no photo downloads. No private originals, embedded JPEGs, profile experiment, source paths, capture dates or photo archive are included. Only aggregate diagnostic measurements are reported here.
Summary by CodeRabbit