fix: stalled jobs, editor cancellation stops and GoPro DNG decoding

Owner review 1, phase 1 (docs/requests/2026-10-15-owner-review-1.md).

Thumbnail and proxy jobs over several sequences counted sequences while
they checkpointed inside one: the rate decayed until the time left
overflowed TimeSpan, the job failed while publishing progress and again
while saving it, and stayed Running. The throughput is now seeded by the
first window with progress, the time left is bounded (JobEta), saving
progress never throws, image passes count frames, and job speeds use the
right unit (bytes for verify and import).

The debugger stops in WicDecoderProvider.cs when presets changed were
cancelled preview decodes leaving synchronous thread-pool delegates; the
editor's sources, LatestRunner and the render node's proxy task now keep
them in their own tasks, and a cancellation is never an unreadable frame.

GoPro DNGs converted by Adobe software were classified GPR and read only
through their 8-bit preview, and Windows' preview-only DNG decoder was
reported as a native decode. A DNG is GPR only when its raw image is
VC-5, WIC decodes RAW only through the Raw Image Extension and never DNG,
analyses and previews take an adequate embedded preview by choice while
renders develop natively, and frames already indexed as GPR are
reclassified by the next light analysis.

Also records the owner's request (docs/requests), the BRIEF amendments
(§8.1, §8.2, new §24), DECISIONS, CHANGELOG, STATUS and ARCHITECTURE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-16 10:20:26 +02:00
1 parent 19265b36c2
commit 34d03051f5
77 files changed
+785 -94

No files matched your search

@@ -306,6 +306,57 @@ public sealed class ManagedDecoderProviderTests(TestContext context)
Assert.Throws<FileNotFoundException>(() => DecoderFactory.CreateServer().Decode(new DecodeRequest(Path.Combine(_dir, "vanished.jpg"))));
}
/// <summary>
/// The owner's archive (R4, owner review 1): GoPro DNGs converted by Lightroom or DNG Converter carry a full-size JPEG
/// preview in IFD0 and a lossless or lossy raw image in a SubIFD. They are DNGs, developed natively; only a VC-5 raw
/// image (or the .gpr extension) makes a GPR.
/// </summary>
[Test]
public void AGoProDngIsGprOnlyWhenItsRawImageIsVc5()
{
using var scene = SyntheticRaw.Smooth(W, H);
var converted = Write("GOPR0100.dng", SyntheticDng.Write(scene, new DngSpec { Make = "GoPro", RawInSubIfd = true, PreviewJpeg = JpegFile(W, H, 1) }));
Assert.Equal(ImageFileFormat.Dng, Signature(converted));
using (var decoded = DecoderFactory.CreateServer().Decode(new DecodeRequest(converted)))
Assert.Equal((DecodeTier.Native, "managed-dng"), (decoded!.Tier, decoded.Decoder));
var vc5 = new IfdSpec().Long(TiffTags.NewSubfileType, 0).Long(TiffTags.ImageWidth, 64).Long(TiffTags.ImageLength, 48)
.Short(TiffTags.BitsPerSample, 16).Short(TiffTags.Compression, 9).Short(TiffTags.PhotometricInterpretation, 32803);
var gpr = Write("GOPR0101.dng", TiffFile.Build(Fixtures.Ifd0("GoPro", "HERO8 Black", 1).Bytes(TiffTags.DngVersion, 1, 4, 0, 0).Child(TiffTags.SubIfds, vc5)));
Assert.Equal(ImageFileFormat.Gpr, Signature(gpr));
var renamed = Write("GOPR0102.GPR", File.ReadAllBytes(converted));
Assert.Equal(ImageFileFormat.Gpr, Signature(renamed));
}
private static ImageFileFormat Signature(string path)
{
using var stream = File.OpenRead(path);
return ImageSignature.Detect(stream, path);
}
[Test]
public void APreferredPreviewIsTakenByChoiceOnlyWhenItIsLargeEnough()
{
using var scene = SyntheticRaw.Smooth(W, H);
var dng = Write("preview.dng", SyntheticDng.Write(scene, new DngSpec { RawInSubIfd = true, PreviewJpeg = JpegFile(W, H, 1) }));
var server = DecoderFactory.CreateServer();
// Analysis size within the preview: the preview, marked as taken by choice (the frame still decodes natively).
using (var quick = server.Decode(new DecodeRequest(dng, MaxLongEdge: 48, Purpose: DecodePurpose.Analysis, PreferPreview: true)))
{
Assert.Equal((DecodeTier.EmbeddedPreview, "managed-preview", true), (quick!.Tier, quick.Decoder, quick.ByChoice));
Assert.Equal(48, quick.Pixels.Width);
}
// Larger than the preview, or no size limit: developed.
using (var native = server.Decode(new DecodeRequest(dng, MaxLongEdge: 4 * W, Purpose: DecodePurpose.Analysis, PreferPreview: true)))
Assert.Equal((DecodeTier.Native, "managed-dng", false), (native!.Tier, native.Decoder, native.ByChoice));
using (var whole = server.Decode(new DecodeRequest(dng, PreferPreview: true)))
Assert.Equal((DecodeTier.Native, false), (whole!.Tier, whole.ByChoice));
// Renders never prefer the preview.
using (var render = server.Decode(new DecodeRequest(dng, MaxLongEdge: 48)))
Assert.Equal((DecodeTier.Native, "managed-dng", false), (render!.Tier, render.Decoder, render.ByChoice));
}
/// <summary>A GoPro GPR as far as Titano reads it: a DNG made by "GoPro" whose only decodable image is a YCbCr JPEG preview.</summary>
private static byte[] Gpr(int previewWidth, int previewHeight)
{