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:
1 parent
19265b36c2
commit
34d03051f5
77 files changed
+785
-94
No files matched your search
@@ -708,6 +708,60 @@ public sealed class AnalysisJobTests(TestContext context)
|
||||
Assert.Empty(SequenceAnalyser.ReadReport(fx.Folder(sequence), sequence.FrameCount)!.Issues.Undecodable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The owner's archive (R4, owner review 1): GoPro DNGs converted by Adobe software were indexed as GPR and recorded
|
||||
/// preview-only. The scan follow-up lists their sequences again, and the light analysis probes them: they become
|
||||
/// DNGs decoded natively, in the sidecar and the index.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GoProDngsIndexedAsGprAreProbedAgainAndBecomeNativeDngs()
|
||||
{
|
||||
await using var fx = await ProcessingFixture.CreateAsync(context);
|
||||
var card = Path.Combine(context.CreateTempDirectory("card"), "DCIM", "100GOPRO");
|
||||
Directory.CreateDirectory(card);
|
||||
var start = new DateTime(2024, 10, 11, 18, 0, 0);
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
var metadata = new FrameMetadata { Make = "GoPro", Model = "HERO8 Black", BodySerial = "C3441", CapturedAt = start.AddSeconds(5 * i) };
|
||||
using var sensor = new ImageBuffer(64, 48);
|
||||
sensor.Plane(1).Fill(0.2f + 0.1f * i);
|
||||
File.WriteAllBytes(Path.Combine(card, $"GOPR{i + 1:0000}.dng"),
|
||||
LinearDngWriter.Write(sensor, new LinearDngOptions { Exif = ExifWriter.BuildTiff(metadata), TileSize = 64 }));
|
||||
}
|
||||
var service = fx.Archive.Service;
|
||||
var plan = await service.PlanImportAsync(fx.Archive.Archive.Id, Path.GetDirectoryName(Path.GetDirectoryName(card))!, new ImportOptions(),
|
||||
cancellationToken: fx.Ct);
|
||||
await service.Imports.ExecuteAsync(new ImportJobParameters(fx.Archive.Archive.Id, plan, null, true, null), Guid.NewGuid(), 0,
|
||||
_ => ValueTask.CompletedTask, null, fx.Ct);
|
||||
var session = plan.Sessions.Single();
|
||||
Assert.Equal(ImageFileFormat.Dng, session.Format);
|
||||
var id = await fx.Db.Sequences.FindBySessionKeyAsync(fx.Archive.Archive.Id, session.SessionKey, fx.Ct);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id!.Value, fx.Ct))!;
|
||||
|
||||
// What an index from before owner review 1 holds: GPR, preview-only, already light-analysed.
|
||||
var folder = fx.Folder(sequence);
|
||||
var manifest = ManifestStore.ReadSequence(folder.ManifestPath);
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest with
|
||||
{
|
||||
Frames = [.. manifest.Frames.Select(f => f with { Format = ImageFileFormat.Gpr, Tier = DecodeTier.EmbeddedPreview, Flags = f.Flags | FrameFlags.PreviewOnly, PreviewW = 64, PreviewH = 48 })],
|
||||
});
|
||||
var rows = await fx.Db.Frames.ListBySequenceAsync(sequence.Id, cancellationToken: fx.Ct);
|
||||
await fx.Db.Frames.UpdateTiersAsync([.. rows.Select(r => new FrameTierFields(r.Id, r.Flags | FrameFlags.PreviewOnly, 64, 48, ImageFileFormat.Gpr))], fx.Ct);
|
||||
await fx.Db.Sequences.UpsertAsync(sequence with { Status = sequence.Status | SequenceStatus.AnalyzedLight }, fx.Ct);
|
||||
Assert.Contains(sequence.Id, await AnalysisFollowUp.UnanalysedAsync(fx.Db, fx.Archive.Archive.Id, fx.Ct));
|
||||
|
||||
await fx.StartEngineAsync();
|
||||
var light = await fx.EnqueueAsync(ProcessingJobs.LightAnalysis([sequence.Id]));
|
||||
await fx.WaitForAsync(light.Id, JobState.Done);
|
||||
var sidecar = ManifestStore.ReadSequence(folder.ManifestPath).Frames;
|
||||
Assert.True(sidecar.All(f => f is { Format: ImageFileFormat.Dng, Tier: DecodeTier.Native } && (f.Flags & FrameFlags.PreviewOnly) == 0),
|
||||
string.Join(", ", sidecar.Select(f => $"{f.Format}/{f.Tier}/{f.Flags}")));
|
||||
var indexed = await fx.Db.Frames.ListBySequenceAsync(sequence.Id, cancellationToken: fx.Ct);
|
||||
Assert.True(indexed.All(f => f.Format == ImageFileFormat.Dng && (f.Flags & FrameFlags.PreviewOnly) == 0), "the index follows");
|
||||
Assert.Equal(0, (await fx.Db.Sequences.GetAsync(sequence.Id, fx.Ct))!.PreviewOnlyCount);
|
||||
Assert.DoesNotContain(sequence.Id, await AnalysisFollowUp.UnanalysedAsync(fx.Db, fx.Archive.Archive.Id, fx.Ct));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task DeepAnalysisNeverFlagsFramesThatVanishedOrCouldNotBeRead()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user