diff --git a/Directory.Build.props b/Directory.Build.props index 3c93a1e..548710a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.0.2 + 1.1.0 Elijah Kuntz AstroFrame diff --git a/README.md b/README.md index 3ac163a..a7a83a5 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ An independent Windows/Linux desktop application for selecting astrophotography For packaged installations, run `AstroFrame-win-x64-Setup.exe`. Linux users can use `AstroFrame-linux-x64.AppImage` and the accompanying `install-linux.sh` for an application-menu entry. Both target x64 PCs. See [installation and releases](docs/releases.md) for Debian/Arch prerequisites and package-building instructions. -**Settings → Updates** shows the installed version and update status, with automatic and manual checks. Installed packages check the [public repository releases](https://git.elijahkuntz.com/Elijah/AstroFrame/releases) on startup and every six hours. A newer stable release adds an update indicator to Settings. **Install update and restart** downloads the release package and restarts after saving; active analysis/export must finish first. Preferences and projects survive updates. Git pushes become app updates only after a versioned release and its packages are published. +**Settings → Updates** shows the installed version and update status, with automatic and manual checks. Installed packages check the [public repository releases](https://git.elijahkuntz.com/Elijah/AstroFrame/releases) on startup and every six hours. A newer stable release turns Settings cerulean blue and adds an update indicator. **Install update and restart** downloads the release package and restarts after saving; active analysis/export must finish first. Preferences and projects survive updates. Git pushes become app updates only after a versioned release and its packages are published. Open `artifacts/AstroFrame/AstroFrame.Desktop.exe`. This self-contained build does not require Python, a GPU, or a separate .NET installation. Keep the entire application folder together. -Windows enforces a **6 GiB process allocation limit** and a **3 GiB managed-heap limit**. Only one desktop instance can run at a time. Analysis uses up to four workers, leaving at least two logical processors unused where available. It rejects images exceeding a 256 MiB per-frame budget and pauses when it cannot leave roughly 25% of physical RAM free (up to 8 GiB). If pressure persists for 20 seconds, completed measurements are saved for resuming. The page file is not counted as available physical RAM. Windows software rendering is used during this release. The larger limit provides headroom; it does not allocate 6 GiB in advance. +Analysis scales its memory budget with physical RAM and samples available headroom before admitting each frame. It reserves one quarter of RAM (up to 8 GiB) for the OS and other applications, counts concurrent frame reservations atomically, and stops safely after 20 seconds of sustained pressure once active frames finish. Windows enforces a process ceiling of physical RAM minus that reserve; the old fixed process, heap and per-frame caps have been removed. Per-frame estimates include working buffers and are bounded by half the machine budget, with the existing 100 MP FITS limit retained. Up to 16 workers are selected from CPU capacity, leaving two logical processors unused where possible. Only one ordinary desktop instance runs at a time. The page file is not treated as available physical RAM. Windows uses software rendering. -`Open Sample Survey.cmd` opens all supplied datasets, including NGC 7000. `Open NGC 7000.cmd` opens its separate project. Normal launches reopen the last project automatically. Reopening a completed project uses saved measurements. New display caches are generated on demand for older projects without recomputing classifications; subsequent previews use cached linear thumbnails. An explicit project can also be opened with `AstroFrame.Desktop.exe --project "project folder"`. +`Open Sample Survey.cmd` opens all supplied datasets, including NGC 7000. `Open NGC 7000.cmd` opens its separate project. Normal launches start with an empty session. Saved projects and decisions remain available when explicitly reopened or when their source folder is selected again. Reopening a completed project uses saved measurements. New display caches are generated on demand for older projects without recomputing classifications; subsequent previews use cached linear thumbnails. An explicit project can also be opened with `AstroFrame.Desktop.exe --project "project folder"`. To analyze another dataset, choose **Analyze lights**, select the folder containing original `.fit`, `.fits`, or `.fts` files, and wait for analysis. Subfolders are included. New projects are saved separately under `%LOCALAPPDATA%/AstroFrame/Projects/` on Windows (the equivalent local application-data location on Linux). The input folder is not used for project storage. @@ -23,6 +23,7 @@ To analyze another dataset, choose **Analyze lights**, select the folder contain - Filter **REVIEW** or **REJECT**, and sort by concern, star count, stellar flux, or FWHM. - Toggle **Compare nearby** and **Spatial overlay**. Red fill shows transient sky structure in the aligned reference grid. Region outlines show forced stellar flux loss. Previews have independent display stretches; use measured flux to compare transparency. - Use **Frame view** for an area-averaged exposure preview, or **Nebula view** for additional averaging of faint diffuse structure. Adjust **Stretch** to brighten the display. These controls never affect measurements, classifications or original files. +- Scroll the mouse wheel over either preview to zoom around the cursor, and hold the left mouse button to drag. Zoom and image position persist across frames and are shared with the nearby comparison. **Reset view** restores the fitted, centered image. These display controls do not alter source pixels or analysis. - Press **1**, **2**, **3** for KEEP, REVIEW, REJECT. Decisions save and advance. **J/K** navigates. **Reset** restores the automatic decision. **Ctrl+Z** undoes a manual decision. - Decision evidence and measurements remain visible below the quality graph. Hover over an evidence line to read its full technical detail, and scroll the panel for additional measurements. Preview stretch and manual decisions sit below the image. Existing notes remain in saved projects and exports; the note editor has been removed. Automatic decisions and human overrides remain separate. @@ -62,7 +63,7 @@ dotnet publish src/AstroFrame.Desktop -c Release -r linux-x64 --self-contained t The Windows build and rendered layout were tested here. Linux uses Avalonia's X11 backend and bundled Skia/Harfbuzz binaries; packaged Linux startup, settings rendering, installation and self-updates were also exercised under Ubuntu WSL. Debian/Arch desktop acceptance remains to be checked directly. A Linux desktop with the usual X11/font/ICU libraries is required; see [installation and releases](docs/releases.md). -Prebuilt Linux files are in `artifacts/AstroFrame-linux`. On Linux, run `chmod +x AstroFrame.Desktop` before launching if executable permissions were lost during transfer. The managed-heap limit and RAM-pressure monitoring also apply on Linux; the Windows kernel job limit does not. +Prebuilt Linux files are in `artifacts/AstroFrame-linux`. On Linux, run `chmod +x AstroFrame.Desktop` before launching if executable permissions were lost during transfer. RAM admission and physical headroom monitoring also apply on Linux; the Windows kernel job ceiling does not. Batch analysis and review-label summaries: diff --git a/docs/analysis-design.md b/docs/analysis-design.md index 544ffe7..b15106b 100644 --- a/docs/analysis-design.md +++ b/docs/analysis-design.md @@ -48,7 +48,7 @@ Small sessions and unreliable references cannot automatically reject. Reference ## Memory, caching and safety -Up to four workers are now selected automatically, leaving two logical processors unused where possible. A 48-frame NGC 7000 measurement benchmark took 9.04/4.99/2.94 seconds with one/two/four workers, with identical star counts and four-worker peak RAM of 250 MiB. This measures the stellar/background stage, not whole-project speedup. No full-resolution image collection or stack is held in RAM. Reference maps are only 960 values per frame. Windows enforces a verified 6 GiB process allocation cap; both executables use a 3 GiB managed-heap cap. A 256 MiB estimated per-frame budget rejects oversized allocations. Analysis checks physical memory before both image passes, reserving up to 8 GiB or one quarter of physical RAM. The page file does not satisfy this reserve. Sustained pressure stops safely and saves measurements. +Version 1.1.0 selects up to 16 workers from CPU capacity, leaving two logical processors unused where possible. A 48-frame measurement run on a 16-logical-processor machine took 2.93 seconds with four workers and 1.32 seconds with fourteen, with identical star counts (peak working sets 251 and 762 MiB). This measures stellar/background processing, not whole-project speedup. No full-resolution image collection or stack is held in RAM. Windows uses a verified process ceiling based on physical RAM minus its reserve, rounded to an allocation boundary. Fixed 6 GiB process, 3 GiB heap and 256 MiB frame caps have been removed. Per-frame estimates include a 64 MiB working margin and are limited to half the machine budget. Both image passes, previews and star detail acquire atomic memory reservations, sampling physical headroom for every frame. The OS/desktop reserve remains one quarter of RAM up to 8 GiB; page-file capacity does not satisfy it. Sustained external pressure stops safely after active frames finish and saves completed measurements. Small JSON metadata stores decisions, notes, evidence and compact masks. Binary versioned caches hold stars, sky maps and forced photometry, validated against source size and modification time and reference identity. A new engine version invalidates analysis without losing human labels. Repeated analysis uses cached measurements and forced apertures when valid. Project writes replace a temporary file atomically. Cancellation leaves analysis incomplete and export disabled. diff --git a/docs/release-notes/1.1.0.md b/docs/release-notes/1.1.0.md new file mode 100644 index 0000000..f83412d --- /dev/null +++ b/docs/release-notes/1.1.0.md @@ -0,0 +1,9 @@ +# AstroFrame 1.1.0 + +- Processing uses more available RAM and CPU capacity. Fixed memory caps have been replaced with a physical-RAM budget and atomic reservations for concurrent frames, retaining headroom for the operating system and other applications. Processing pauses under RAM pressure and preserves completed work if pressure persists. +- Scroll over a preview to zoom around the cursor and drag with the left mouse button to pan. Zoom and position carry across frames and the nearby comparison. **Reset view** fits and centers both previews. Overlays follow the transformed image. +- Ordinary launches begin with a fresh, empty session. Saved projects and decisions remain on disk; explicit project opening and update restarts still restore the requested project. +- **Settings · Update available** turns cerulean blue when an update is available. +- The native startup background matches the application's charcoal grey. + +Validation covers engine/resource policy, updater safety, mocked publication, routed mouse events, preview resets and frame switching, rendered layouts at normal and minimum size including 144 DPI, and Windows native window behavior. A 48-frame measurement benchmark on a 16-thread machine improved from 2.93 seconds with four workers to 1.32 seconds with fourteen workers, with identical star counts; this is not a whole-project speed guarantee. Development verification uses workspace fixtures and a fake updater, leaving installed copies untouched. diff --git a/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj b/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj index c54e997..f549a63 100644 --- a/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj +++ b/src/AstroFrame.Desktop/AstroFrame.Desktop.csproj @@ -1,4 +1,4 @@ - + WinExe @@ -10,7 +10,6 @@ - diff --git a/src/AstroFrame.Desktop/DesktopState.cs b/src/AstroFrame.Desktop/DesktopState.cs deleted file mode 100644 index e5bca1c..0000000 --- a/src/AstroFrame.Desktop/DesktopState.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Text.Json; - -namespace AstroFrame.Desktop; - -internal static class DesktopState -{ - static string PathName=>System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),"AstroFrame","desktop.json"); - public static void Remember(string projectDirectory) - { - if(Program.Arguments.Any(a=>a.StartsWith("--capture",StringComparison.Ordinal)||a=="--smoke"))return; - try - { - Directory.CreateDirectory(System.IO.Path.GetDirectoryName(PathName)!); - File.WriteAllText(PathName+".tmp",JsonSerializer.Serialize(new Dictionary{{"LastProject",projectDirectory}}));File.Move(PathName+".tmp",PathName,true); - } - catch(IOException){}catch(UnauthorizedAccessException){} - } - public static string? LastProject() - { - try - { - if(!File.Exists(PathName)||new FileInfo(PathName).Length>4096)return null; - var state=JsonSerializer.Deserialize>(File.ReadAllText(PathName)); - string? directory=state?.GetValueOrDefault("LastProject");return directory!=null&&File.Exists(System.IO.Path.Combine(directory,"project.json"))?directory:null; - } - catch(IOException){return null;}catch(JsonException){return null;}catch(UnauthorizedAccessException){return null;} - } -} diff --git a/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs b/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs new file mode 100644 index 0000000..095b3d1 --- /dev/null +++ b/src/AstroFrame.Desktop/DiagnosticUpdateBackend.cs @@ -0,0 +1,11 @@ +namespace AstroFrame.Desktop; + +// Diagnostic rendering never initializes the installed update locator or reads preferences. +internal sealed class DiagnosticUpdateBackend : IUpdateBackend +{ + public bool IsInstalled=>true; + public string InstalledVersion=>typeof(MainWindow).Assembly.GetName().Version?.ToString(3)??"1.1.0"; + public Task Check()=>Task.FromResult("9.0.0"); + public Task Download(Action progress,CancellationToken cancellation)=>throw new InvalidOperationException("Rendering diagnostics cannot download updates."); + public void ApplyAndRestart(string[] arguments)=>throw new InvalidOperationException("Rendering diagnostics cannot install updates."); +} diff --git a/src/AstroFrame.Desktop/MainWindow.Updates.cs b/src/AstroFrame.Desktop/MainWindow.Updates.cs index e04dfa9..5aab934 100644 --- a/src/AstroFrame.Desktop/MainWindow.Updates.cs +++ b/src/AstroFrame.Desktop/MainWindow.Updates.cs @@ -1,25 +1,30 @@ using Avalonia.Controls; using Avalonia.Threading; using Avalonia.Controls.ApplicationLifetimes; +using Avalonia; +using Avalonia.Styling; +using Avalonia.Controls.Presenters; namespace AstroFrame.Desktop; public sealed partial class MainWindow { - readonly AppUpdates updates = new(); + readonly AppUpdates updates = Program.Diagnostic ? new(new DiagnosticUpdateBackend(),new AppSettings(),_=>{}) : new(); readonly Button settingsButton = Button("Settings"); readonly DispatcherTimer updateTimer = new() { Interval = TimeSpan.FromHours(6) }; SettingsWindow? settingsWindow; void InitializeUpdates() { + Styles.Add(new Style(x=>x.OfType