refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s

The owner renamed the product and moved the repository to the self-hosted
Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control,
and asked for Actions and a first automatic release with the server package
and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md).

- Chronos everywhere: a byte-exact rename of contents and paths, then a
  per-language review of the forms the old name's ending had dictated.
- Gitea instead of GitHub: the update check, licence, issue and support
  links read ChronosReleasesUrl; the update check takes the highest stable
  version, offers a pre-release build its final release and reports a
  repository it cannot see as a failed check. EULA, security policy and
  Gitea issue forms live at the repository root.
- Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release,
  nightly image and performance gates in the .NET SDK container with git
  checkout and the system SQLite. The release cross-compiles the Windows
  programs, checks their icon, version and DPI manifest, packs installers
  and zips, publishes the Gitea release and pushes the server image
  (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows
  runner (WINDOWS_RUNNER).
- New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the
  docker-exec script, which Gitea's service containers do not allow; the
  throw-away server runs without durability) and pe-check.
- Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR,
  3 on the shared runner; the weekly performance gates keep theirs).

BREAKING CHANGE: programs, settings, data folders, file types, environment
variables and the Docker image use the new name; nothing is migrated from
Titano, which never had a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-10-23 12:45:18 +02:00
1 parent c99842cc86
commit f2b58522b9
1801 files changed
+11804 -10676

No files matched your search

@@ -0,0 +1,194 @@
using Chronos.Core.Imaging;
using Chronos.Core.Motion;
using Chronos.Testing;
namespace Chronos.Core.Tests.Motion;
public sealed class TemporalStackerTests
{
private const int Size = 96;
private readonly TestContext _context;
public TemporalStackerTests(TestContext context) => _context = context;
[Test]
public void StarTrailLuminanceNeverDecreasesWithUnitDecay()
{
var random = new Random(5);
using var stacker = new StarTrailStacker(1.0);
using var frame = new ImageBuffer(Size, Size);
var previous = new float[Size * Size];
var current = new float[Size * Size];
long steps = 0, nonDecreasing = 0;
for (var k = 0; k < 40; k++)
{
NightFrame(frame, random, k);
stacker.Add(frame);
ColorSpace.Luminance(stacker.Result!, current);
if (k > 0)
{
for (var i = 0; i < current.Length; i++)
{
steps++;
if (current[i] >= previous[i]) nonDecreasing++;
}
}
(previous, current) = (current, previous);
}
var fraction = nonDecreasing / (double)steps;
_context.Log($"non-decreasing on {fraction:P3} of {steps} pixel steps");
Assert.GreaterOrEqual(fraction, 0.99);
Assert.Equal(40, stacker.Count);
// The trail of the first star position is still lit after 40 frames.
Assert.Greater(stacker.Result![1, StarX(0), StarY(0)], 0.5f);
}
[Test]
public void FiniteTrailsFadeToOnePercentOverTheirLength()
{
Assert.Equal(1.0, StarTrailStacker.DecayForTrailLength(double.PositiveInfinity));
Assert.Equal(1.0, StarTrailStacker.DecayForTrailLength(0));
var decay = StarTrailStacker.DecayForTrailLength(20);
Assert.Approximately(0.01, double.Pow(decay, 20), 1e-12);
using var stacker = new StarTrailStacker(decay);
using var lit = new ImageBuffer(8, 8, 1);
using var dark = new ImageBuffer(8, 8, 1);
lit[0, 3, 3] = 1f;
stacker.Add(lit);
for (var k = 0; k < 20; k++) stacker.Add(dark);
Assert.Approximately(0.01, stacker.Result![0, 3, 3], 1e-5);
}
[Test]
public void MedianRemovesATransientOutlierFrame()
{
var plane = SyntheticImages.Crop(SyntheticImages.Natural(128, seed: 12), 128, 0, 0, Size, Size);
var random = new Random(8);
using var stacker = new TemporalStacker(7, StackMode.Median);
for (var k = 0; k < 7; k++)
{
using var frame = SyntheticImages.ToRgb(plane, Size, Size);
var data = frame.Data;
for (var i = 0; i < data.Length; i++) data[i] += 0.01f * (float)(random.NextDouble() - 0.5);
if (k == 3)
{
// An aircraft light streak crossing one frame.
for (var c = 0; c < 3; c++)
for (var x = 10; x < 80; x++)
frame[c, x, 40 + x / 8] = 5f;
}
stacker.Push(frame);
}
Assert.True(stacker.IsFull);
using var output = new ImageBuffer(Size, Size);
stacker.Render(output);
using var reference = SyntheticImages.ToRgb(plane, Size, Size);
double maxError = 0;
for (var i = 0; i < output.Data.Length; i++) maxError = double.Max(maxError, double.Abs(output.Data[i] - reference.Data[i]));
_context.Log($"max deviation from the clean frame {maxError:F4}");
Assert.Less(maxError, 0.01);
}
[Theory]
[Case(1)]
[Case(5)]
[Case(6)]
[Case(32)]
[Case(33)]
public void MedianIsExact(int count)
{
var random = new Random(count);
var frames = new List<ImageBuffer>();
try
{
for (var k = 0; k < count; k++)
{
var frame = new ImageBuffer(37, 5, 3);
var data = frame.Data;
for (var i = 0; i < data.Length; i++) data[i] = (float)random.NextDouble();
frames.Add(frame);
}
using var output = new ImageBuffer(37, 5, 3);
TemporalStacker.Median(frames, output);
for (var i = 0; i < output.Data.Length; i++)
{
var sorted = frames.Select(f => f.Data[i]).Order().ToArray();
var expected = count % 2 == 1 ? sorted[count / 2] : 0.5f * (sorted[count / 2 - 1] + sorted[count / 2]);
Assert.Equal(expected, output.Data[i]);
}
}
finally
{
foreach (var f in frames) f.Dispose();
}
}
[Test]
public void MeanReducesNoiseBySquareRootOfN()
{
const int n = 16;
const double sigma = 0.05;
var random = new Random(3);
using var stacker = new TemporalStacker(n, StackMode.Mean);
using var frame = new ImageBuffer(Size, Size, 1);
for (var k = 0; k < n; k++)
{
var data = frame.Data;
for (var i = 0; i < data.Length; i++) data[i] = 0.4f + (float)(sigma * Gaussian(random));
stacker.Push(frame);
}
using var output = new ImageBuffer(Size, Size, 1);
stacker.Render(output);
var values = output.Data.ToArray();
var mean = values.Average(v => (double)v);
var std = double.Sqrt(values.Average(v => (v - mean) * (v - mean)));
_context.Log($"residual σ {std:F5} (expected {sigma / double.Sqrt(n):F5})");
Assert.Approximately(0.4, mean, 0.002);
Assert.Approximately(sigma / double.Sqrt(n), std, 0.15 * sigma / double.Sqrt(n));
}
[Test]
public void WindowSlidesOverTheNewestFrames()
{
using var stacker = new TemporalStacker(3, StackMode.Median);
using var frame = new ImageBuffer(4, 4, 1);
for (var k = 0; k < 10; k++)
{
frame.Data.Fill(k);
stacker.Push(frame);
}
Assert.Equal(3, stacker.Count);
using var output = new ImageBuffer(4, 4, 1);
stacker.Render(output);
Assert.True(output.Data.ToArray().All(v => v == 8f));
using var other = new ImageBuffer(5, 4, 1);
Assert.Throws<ArgumentException>(() => stacker.Push(other));
stacker.Clear();
Assert.Throws<InvalidOperationException>(() => stacker.Render(output));
}
private static int StarX(int k) => 20 + k;
private static int StarY(int k) => 30 + k / 3;
/// <summary>Dark noisy sky with one star drifting one pixel per frame and a few twinkling faint ones.</summary>
private static void NightFrame(ImageBuffer frame, Random random, int k)
{
var data = frame.Data;
for (var i = 0; i < data.Length; i++) data[i] = 0.002f + 0.001f * (float)random.NextDouble();
for (var c = 0; c < 3; c++)
{
frame[c, StarX(k), StarY(k)] = 0.9f;
frame[c, 60, 70] = 0.1f + 0.05f * (k % 3);
}
}
private static double Gaussian(Random random)
{
var u1 = 1.0 - random.NextDouble();
var u2 = random.NextDouble();
return double.Sqrt(-2 * double.Log(u1)) * double.Cos(2 * double.Pi * u2);
}
}