Skip to content

Add macOS and Windows release scripts#3

Draft
mondain wants to merge 6 commits into
mainfrom
docker-build
Draft

Add macOS and Windows release scripts#3
mondain wants to merge 6 commits into
mainfrom
docker-build

Conversation

@mondain
Copy link
Copy Markdown
Collaborator

@mondain mondain commented Apr 24, 2026

I added windows and mac, just in-case as well as the std ubuntu20 docker builds for arm64 and amd64.

@mondain mondain requested a review from kdkd April 24, 2026 20:08
mondain and others added 3 commits April 24, 2026 13:52
Mirrors the bash script's flag surface (-All/-Mingw/-Msvc) and target
handling so the Windows MSVC artifact can be built from a native
Developer PowerShell without needing MSYS2/Git Bash. MinGW path shells
out to make (or mingw32-make); MSVC path invokes cl/lib directly over
the same 8 sources, then packages with Compress-Archive + Get-FileHash
to produce the same zip + .sha256 + BUILD_INFO layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds scripts/build-windows-arm64.ps1, a focused PowerShell driver that
builds Windows-on-ARM64 release artifacts via either MinGW (cross compile
through aarch64-w64-mingw32-gcc) or MSVC (native ARM64 from a VS ARM64
developer shell). Mirrors the package layout of build-windows.ps1.

The MSVC path used to ship scalar-only because the NEON kernels and arch
detection were gated on __aarch64__, which MSVC does not define. Widen the
guards to (__aarch64__ || _M_ARM64) across internal.h, detect.c, the SDR
and HDR dispatchers, the three NEON kernel files, and tonemap.c. detect.c
gains a Windows branch alongside __APPLE__ that just sets has_neon = 1
since NEON is architecturally mandatory on Windows on ARM.

The NEON kernels also relied on GCC-only constructs that MSVC rejects.
Add FUSED_HOT and FUSED_PREFETCH portability macros in internal.h with
MSVC ARM64 fallbacks (FUSED_PREFETCH uses __prefetch from <intrin.h>);
replace per-variable __attribute__((aligned(N))) with the C11 _Alignas(N)
keyword; drop the now-redundant local FUSED_HOT in tonemap.c.

INSTALL.md documents the new script and the build-windows.ps1 variants
alongside the existing bash flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread scripts/build-windows.ps1
}

function Invoke-MsvcBuild {
$commonSources = @(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I'm really stupid about windows, but do we need to explicitly include the AVX src files here so that it doesn't just fall back to the scalar functions every time?

mondain and others added 2 commits April 28, 2026 07:01
fused_hdr_init's tonemap_1x and "no valid steps" error paths called
fused_hdr_free(ctx) while ctx->_internal was still NULL, which skipped
the cleanup of state->sdr_temp[i] buffers populated by SDR-only steps
in the per-step loop.  Init now attaches state to ctx->_internal
immediately after allocation so any subsequent error path goes through
fused_hdr_free and releases everything.

Drive-by fixes uncovered by the same review:

- Internal-state OOM previously returned the misleading FUSED_ERR_NO_STEPS;
  added FUSED_ERR_OUT_OF_MEMORY (-5) and used it in both inits.
- The "no SIMD support detected" notice bypassed log_warnings and wrote
  to stderr directly; it now routes through fused_log so callers using
  FUSED_LOG_SUPPRESS / FUSED_LOG_CALLBACK actually control it.
- The misaligned-source warning used a process-wide static "warned"
  flag; the first context to hit it silenced every other context.
  Moved the flag onto fused_internal_t / fused_hdr_internal_t.
- Restored the "tone map LUTs generated" diagnostic at the new
  FUSED_LOG_INFO (2) level (it was previously WARN, which polluted
  warning channels) and documented that info is routed via
  log_warnings so callbacks can filter on level.
- fused_*_free now also resets effective_width/height for consistency.
- Added trailing newline to the misalignment warning format strings.

Docs updated: docs/API.md tables for log levels and error codes,
README's "Platform support" wording, and a new CHANGELOG.md tracking
all of the above under [Unreleased].

Verified: make lib + make funnelcake_test build clean under
-Wall -Wextra -Werror; full test suite 83/83 on Apple Silicon.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants