Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/quality_windows_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Quality / Windows installer previews

on:
push:
branches: [codex/windows-arm64]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: windows-arm64-preview-${{ github.ref }}
cancel-in-progress: true

jobs:
preview:
name: Windows ${{ matrix.architecture }} preview
strategy:
fail-fast: false
matrix:
include:
- architecture: arm64
runner: windows-11-arm
rust: aarch64-pc-windows-msvc
- architecture: x64
runner: windows-2022
rust: x86_64-pc-windows-msvc
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
env:
FLUTTER_HOST_ARCH: ${{ matrix.architecture }}
CI: "true"
steps:
- name: Check out Ame
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

# The Windows SDK archive ships x64 Dart. The framework checkout bootstraps native Dart.
- name: Check out Flutter 3.50.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: flutter/flutter
ref: 3.50.0
path: build/flutter-sdk
persist-credentials: false

- name: Select the native toolchain
shell: pwsh
run: |
if ((git -C build/flutter-sdk rev-parse HEAD) -cne 'ab2912035e160d9cad6306df307576da6128ebdb') {
throw 'Unexpected Flutter 3.50.0 revision'
}
(Resolve-Path build/flutter-sdk/bin).Path >> $env:GITHUB_PATH
rustup set default-host ${{ matrix.rust }}

- name: Build, launch and read the catalog through the Release bridge
shell: pwsh
run: ./tool/quality_windows_preview.ps1 -Architecture ${{ matrix.architecture }}

- name: Upload portable preview
if: matrix.architecture == 'arm64'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Cedarflake-Ame-windows-arm64-preview
path: build/windows/arm64/runner/Release/
if-no-files-found: error
retention-days: 14

- name: Package MSI with offline models
shell: pwsh
run: |
$arch = $env:FLUTTER_HOST_ARCH
$tag = 'v' + ((Select-String -LiteralPath pubspec.yaml -Pattern '^version: ([^+]+)\+' -Encoding utf8).Matches.Groups[1].Value)
$cache = Get-Content -LiteralPath "build/windows/$arch/CMakeCache.txt" -Encoding utf8
$env:CMAKE_GENERATOR = ($cache | Select-String '^CMAKE_GENERATOR:INTERNAL=(.+)$').Matches.Groups[1].Value
$cmake = ($cache | Select-String '^CMAKE_COMMAND:INTERNAL=(.+)$').Matches.Groups[1].Value
$wix = ./tool/release_prepare_installer_toolchain.ps1 -OutputDirectory build/installer-toolchain
./tool/release_package_installer_windows.ps1 @wix -Tag $tag -Architecture $arch `
-BundlePath "build/windows/$arch/runner/Release" -UnsignedEvidencePath "build/windows/$arch/preview-evidence.json" `
-CMakePath $cmake -OutputDirectory build/preview-installer -AcceptWixBinaryEula -MsiOnly

- name: Install, repair and uninstall on Windows 11
if: matrix.architecture == 'arm64'
shell: pwsh
run: ./tool/acceptance_windows_msi_preview.ps1 -PackageDirectory build/preview-installer

- name: Upload verified installer
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Cedarflake-Ame-windows-${{ matrix.architecture }}-msi
path: build/preview-installer/*.msi
compression-level: 0
if-no-files-found: error
retention-days: 14
1 change: 1 addition & 0 deletions .github/workflows/release_package_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ jobs:
id: installer_identity
shell: pwsh
env:
CMAKE_GENERATOR: Visual Studio 17 2022
AME_PORTABLE_ARCHIVE: ${{ steps.portable_identity.outputs.archive_path }}
run: |
$ErrorActionPreference = 'Stop'
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ flutter pub get
flutter run -d windows
```

### Windows 11 installer previews

The [preview workflow](.github/workflows/quality_windows_arm64.yml) builds unsigned **x64 and ARM64
MSI installers**. Download `Cedarflake-Ame-windows-x64-msi` for Intel or AMD PCs, or
`Cedarflake-Ame-windows-arm64-msi` for Windows on Arm. Extract the MSI from the Actions artifact
and run it. Both include the offline models and the native journal service. If you previously
installed the x64 edition on an Arm PC, uninstall it before installing the ARM64 edition.
Your catalog, preferences and source files are retained.

The `Cedarflake-Ame-windows-arm64-preview` artifact contains the ARM64 portable app. Extract
the whole ZIP and open `cedarflake_ame.exe`. The portable app downloads optional models on request.

For a native build, use Visual Studio's ARM64 C++ tools and ARM64 Rust. Set
`$env:FLUTTER_HOST_ARCH = "arm64"` before first running Flutter from a fresh checkout of the
`3.50.0` Flutter tag. This bootstraps the ARM64 Dart SDK. Run the commands above using that SDK,
or use `flutter build windows --release` for the bundle in `build/windows/arm64/runner/Release`.

The interface is built with Flutter and Material 3. Rust handles the catalog, file tracking,
previews, image analysis, and file operations, with SQLite storing the library.

Expand Down
13 changes: 10 additions & 3 deletions docs/architecture/0015-windows-release-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ the executable's `FLUTTER_VERSION` resource. Startup diagnostics attach that ide
Rust runtime or catalog cannot open. Reading it needs no platform request, catalog or startup wait.
Package receipts use the matching manifest version, and release-note admission uses its tag.

Only Windows 11 x64 is supported and published. ARM packages are not produced or implied. A hosted
`windows-2025` Windows Server runner supplies reproducible build and release checks, but it does not
Tagged releases target Windows 11 x64. The [native preview workflow](../../.github/workflows/quality_windows_arm64.yml)
provides experimental x64 and ARM64 MSIs and the ARM64 portable application. Each native runner checks
the Release window and reads the catalog through its packaged Rust bridge. Both installers include
architecture-matched CPU and DirectML engines, the broker and offline models. The ARM64 MSI also
passes through fresh installation, repair and removal on a disposable Windows 11 client before upload.

A hosted `windows-2025` Windows Server runner supplies reproducible x64 build and release checks, but it does not
replace the separately authorized Windows 11 client acceptance evidence.
Installer packaging uses `windows-2022` to retain the Visual Studio 2022 generator required by
the native installer policy module. This packaging host does not change the supported client OS.
Expand All @@ -90,9 +95,11 @@ missing ICU or application data, and missing Flutter assets.
CMake's `InstallRequiredSystemLibraries` copies the selected MSVC toolchain's redistributable
Release libraries beside the executable. Candidate and archive admission require `msvcp140.dll`, `msvcp140_1.dll`,
`vcruntime140.dll` and `vcruntime140_1.dll`; Debug runtimes and system-directory copies are excluded.
The same four libraries accompany each CPU/GPU model runtime in its own directory, preserving
The same four libraries accompany each x64 CPU/GPU model runtime in its own directory, preserving
the worker's restricted DLL search. Portable admission checks these copies against the application
root's lengths and hashes while retaining the pinned engine manifest and exact directory contents.
The native ARM64 engines import `msvcp140.dll`, `msvcp140_1.dll` and `vcruntime140.dll`.
The ARM64 preview excludes the x64 `vcruntime140_1.dll` supplied for emulation.
This follows Flutter's [Windows deployment guidance](https://docs.flutter.dev/platform-integration/windows/building)
and Microsoft's [redistributable-file terms](https://learn.microsoft.com/en-us/cpp/windows/redistributing-visual-cpp-files).
The Visual Studio build operator must hold the applicable distribution rights; the binaries retain
Expand Down
13 changes: 9 additions & 4 deletions docs/architecture/0027-windows-installer-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- Status: Accepted
- Date: 2026-10-12
- Last amended: 2026-11-16
- Last amended: 2026-11-20

## Context and decision drivers

Expand All @@ -13,7 +13,7 @@ local builds, retain user data and restore the preceding installation if an upgr

## Decision

Use an x64, per-machine MSI built with WiX Toolset 7.0.0. Windows Installer owns file components,
Build one per-machine MSI per supported architecture using WiX Toolset 7.0.0. Windows Installer owns file components,
product registration, service installation/configuration/control and transactional rollback.
Distribute the MSI alongside the portable ZIP. A native WiX Burn executable using
`WixInternalUIBootstrapperApplication` remains available for early elevation and cached maintenance.
Expand All @@ -25,7 +25,12 @@ of the desktop application. Native actions validate protected destinations and e
then own bounded service startup, its paired rollback stop and restoration of the preceding
service's restricted configuration. MSI retains the installation transaction.

The upgrade identity is `C284E6B0-1484-4926-A94B-C3EC3840DBBD`. The release tag and application
The x64 upgrade identity is `C284E6B0-1484-4926-A94B-C3EC3840DBBD`. The ARM64 preview uses
`293D2430-983F-5117-BB52-64978D653436`. Each family owns its product codes. Both packages
use the same fixed broker service name and check the other family's Windows Installer registration
before mutation. A fresh install requires the native machine architecture. Switching from an
emulated x64 installation requires uninstalling it first, which retains the user's catalog.
Same-architecture upgrades and repairs use the existing transactional lifecycle. The release tag and application
retain their full semantic version, including prerelease identifiers. MSI `ProductVersion` uses
`major.minor.build`, with the positive numeric build suffix from Flutter's `pubspec.yaml` as its
third component. For example, `0.1.0-alpha.1+1` produces MSI version `0.1.1`. Increment the build
Expand Down Expand Up @@ -61,7 +66,7 @@ product registration and shortcut. It never owns source directories, catalogs, p
user decisions or operation history. Removal of unknown files or recursive deletion of the
installation directory is not part of uninstall.

Keep the broker beneath native `FOLDERID_ProgramFilesX64` in fixed `Cedarflake Ame/Journal Broker`
Keep the broker beneath the native process's `FOLDERID_ProgramFiles` in fixed `Cedarflake Ame/Journal Broker`
directories. The application defaults to the sibling `Application` directory and may use another
local protected installation directory selected through a native MSI path field and folder browser.
Reject volume roots, overlap with the protected broker, redirected/reparse destinations, untrusted parent
Expand Down
9 changes: 7 additions & 2 deletions docs/architecture/0034-versioned-classification-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,9 @@ storage is a separate rebuildable database beside the active catalog, outside th

The Windows CMake dependency prepares the hash-pinned official runtime archive before the application
target can complete. Its distribution manifest records archive and individual-file lengths and
SHA-256 digests, with a regression binding both DLL entries to the worker's compiled artifact pins.
SHA-256 digests. The worker reads its compiled-in target manifest for binary admission.
Preparation streams at most the admitted archive length with a five-minute timeout, extracts only
the seven admitted files, verifies them and publishes a complete new build directory by rename.
the files named by that manifest, verifies them and publishes a complete new build directory by rename.
Interrupted staging is disposable; an existing build directory must pass every artifact check before
reuse. Corrupt existing output fails the build for explicit inspection rather than being silently
trusted. The package cache lives under repository `build`; no runtime download occurs during app
Expand All @@ -885,6 +885,11 @@ An upgrade replaces the bundle through the existing application packaging lifecy
or digest changes require renewed adapter admission and feature compatibility; there is no fallback
to a system-installed runtime or a different DLL found on the search path. Reverting a bundle restores
its matching runtime without changing model files, catalogs or human decisions.
For installations recorded with Ame's `data/classification-runtime` layout, enablement and worker
startup resolve that directory beside the running executable. When the saved model selection also
belongs to the previous bundle and the current installation contains the same model package, use
the current installation's copy. A portable build without bundled models uses the saved model
directory. Custom model and runtime directories retain their stored paths.

DLL dependency lookup is restricted to Windows system libraries and the pinned runtime directory;
the current directory and arbitrary search-path entries are excluded inside the worker.
Expand Down
9 changes: 9 additions & 0 deletions docs/architecture/0039-gpu-classification-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ It does not install a system runtime. Microsoft.AI.DirectML's binary uses Micros
license, not MIT; retain its supplied Windows ML distribution terms and notices. ONNX Runtime is
MIT, ONNX schema and prost are Apache-2.0, and half is MIT/Apache-2.0 (used under Apache-2.0).

Both architectures obtain their CPU DLLs and upstream revision metadata from the official
Microsoft.ML.OnnxRuntime NuGet package. Its x64 DLLs match the original release ZIP byte for byte.
The packager preserves the x64 version and commit files using the NuGet metadata and verifies their
existing hashes. The Windows ARM64 preview uses the same engine versions. Its GPU DLLs come
from the ARM64 entries in the same two DirectML packages as x64. Each architecture's manifests
bind the worker pins and package contents. Switching architectures recognizes the previous run
and selects a new pipeline through the existing configuration transaction. The x64 screening
calibration applies only to its measured CPU pipeline.

The generated ONNX types come from ONNX 1.20.1's `onnx/onnx-ml.proto` descriptor. Regeneration is
owned by `tool/bridge_generate_onnx_schema.ps1`; the generator pins the descriptor digest and prost
version. Schema attribution and the Apache-2.0 license ship through the native-license registry.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"schema": 1,
"platform": "windows-arm64",
"bundleDirectory": "data/classification-accelerator",
"archives": [
{
"id": "onnxruntime",
"version": "1.24.4",
"url": "https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime.directml/1.24.4/microsoft.ml.onnxruntime.directml.1.24.4.nupkg",
"length": 12458649,
"sha256": "57e9f11b73437bef7a309496135d4c1f96b1a8e9ddba60013fa27bfc1d788681",
"prefix": ""
},
{
"id": "directml",
"version": "1.15.4",
"url": "https://api.nuget.org/v3-flatcontainer/microsoft.ai.directml/1.15.4/microsoft.ai.directml.1.15.4.nupkg",
"length": 202292617,
"sha256": "4e7cb7ddce8cf837a7a75dc029209b520ca0101470fcdf275c1f49736a3615b9",
"prefix": ""
}
],
"files": [
{
"archive": "onnxruntime",
"entry": "runtimes/win-arm64/native/onnxruntime.dll",
"name": "onnxruntime.dll",
"length": 17546784,
"sha256": "939fa0be435d253eadd9e394ee94ad6b6ac1878c83b64118bb4bda669eb0e28c"
},
{
"archive": "onnxruntime",
"entry": "runtimes/win-arm64/native/onnxruntime_providers_shared.dll",
"name": "onnxruntime_providers_shared.dll",
"length": 21528,
"sha256": "3923290b6fc5dcd754b4d533463a9b8b46da0889d3991ef4f9b9afa17929e3e2"
},
{
"archive": "onnxruntime",
"entry": "LICENSE",
"name": "LICENSE-ONNXRuntime.txt",
"length": 1094,
"sha256": "c250d6278f0b47a6439fb7592b08b58a55eb9f535aa49a1db63211c3f982b674"
},
{
"archive": "onnxruntime",
"entry": "Privacy.md",
"name": "Privacy.md",
"length": 2490,
"sha256": "bfb7712b075f3f07e3ebee5dc2a296d1de32dbf71ad28663f73d1538cb6c3b08"
},
{
"archive": "onnxruntime",
"entry": "ThirdPartyNotices.txt",
"name": "ThirdPartyNotices-ONNXRuntime.txt",
"length": 331175,
"sha256": "fb0af774b4d7cffc5b9d046f2aaeade2f37df2f80abf8033c95dfffcc77a8866"
},
{
"archive": "directml",
"entry": "bin/arm64-win/DirectML.dll",
"name": "DirectML.dll",
"length": 18444832,
"sha256": "77b0db83ff903f2323f5caf538499d75af6038bbea23b7959f7d232d9a4ab9d4"
},
{
"archive": "directml",
"entry": "LICENSE.txt",
"name": "LICENSE-DirectML.txt",
"length": 10439,
"sha256": "a05138e3a085ff60a44881eedfa58dccb03ecc1d7b1f6ae888418e8c2fec4b8d"
},
{
"archive": "directml",
"entry": "LICENSE-CODE.txt",
"name": "LICENSE-CODE-DirectML.txt",
"length": 1093,
"sha256": "903df5512f7d02609fed0c780a9b704f5a3eeb6e4d84ebe42a29845c81899a3c"
},
{
"archive": "directml",
"entry": "ThirdPartyNotices.txt",
"name": "ThirdPartyNotices-DirectML.txt",
"length": 4577,
"sha256": "2c95795c13ff48a58b6ed916f37901c23d964b5d9d601af422f17ad2172e7950"
}
]
}
13 changes: 5 additions & 8 deletions rust/src/adapters/classification_runtime/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use windows_sys::Win32::Storage::FileSystem::{
};

use super::manifest::{self, Artifact};
use super::{EncoderBackend, EncoderKind, RuntimeError, backend};
use super::{EncoderBackend, EncoderKind, RuntimeError, binaries};

pub(super) struct ArtifactSet {
pub runtime: PathBuf,
Expand All @@ -33,21 +33,18 @@ impl ArtifactSet {
backend: EncoderBackend,
) -> Result<Self, RuntimeError> {
let mut guards = pin_directory(models)?;
let binaries = binaries::native();
let (runtime, runtime_files) = match backend {
EncoderBackend::Cpu => (
runtime.to_path_buf(),
vec![&manifest::RUNTIME, &manifest::PROVIDER],
vec![&binaries.cpu, &binaries.cpu_provider],
),
EncoderBackend::DirectMl { device_id }
if kind == EncoderKind::Image && device_id >= 0 =>
{
(
runtime.with_file_name("classification-accelerator"),
vec![
&backend::GPU_RUNTIME,
&backend::GPU_PROVIDER,
&backend::DIRECTML,
],
vec![&binaries.gpu, &binaries.gpu_provider, &binaries.directml],
)
}
_ => return Err(RuntimeError::Configuration),
Expand All @@ -69,7 +66,7 @@ impl ArtifactSet {
None
};
Ok(Self {
runtime: runtime.join(manifest::RUNTIME.name),
runtime: runtime.join(binaries.cpu.name),
graph: models.join(graph.name),
tokenizer,
_guards: guards,
Expand Down
17 changes: 0 additions & 17 deletions rust/src/adapters/classification_runtime/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,3 @@ pub enum EncoderBackend {
device_id: i32,
},
}

pub(super) const GPU_RUNTIME: super::manifest::Artifact = super::manifest::Artifact {
name: "onnxruntime.dll",
length: 17_328_152,
digest: "e7eedec6a6f26dc39dc948276a75ef6d2bee3fff944d874ceed0bbd3b97bff40",
};
#[cfg(any(windows, test))]
pub(super) const GPU_PROVIDER: super::manifest::Artifact = super::manifest::Artifact {
name: "onnxruntime_providers_shared.dll",
length: 22_040,
digest: "265c8daf29637cb259cac8be9f08f2cd45f3883f0f0e4949cbfddd5b4cbec3b6",
};
pub(super) const DIRECTML: super::manifest::Artifact = super::manifest::Artifact {
name: "DirectML.dll",
length: 18_527_776,
digest: "9c9e6d822561c6c41b90e6994b3e8857cf1d66dbfb1e0c4c799c7c89b4e92da1",
};
Loading