docs/macos-qualification.md
Reproducing the combined Mac qualification
This repository owns the font/window/UI integration fixture and its combined packet. Font-specific C models/object gates remain in sigil-font. The single resource monitor is scripts/macos/setup.sgl, shared by the UI check and native dependency audit. Limits and candidate source directories are explicit inputs; the font gates contain no machine-specific affinity, memory or disk policy.
Use Sigil 0.24.8 and Zig 0.16.0 on Linux. Set SIGIL_MACOS_FONT_SOURCE and SIGIL_MACOS_WINDOW_SOURCE to absolute accepted candidate source directories. Set SIGIL_FEATURES=cross,darwin for dependency installation and Mac builds. From test/macos-drawing, run sigil deps install then sigil build -c darwin-arm64. The manifest selects this repository's UI and the two supplied candidates by qualified local names.
The drawing host deliberately enables SIGIL_FONT_CORETEXT_TEST so the private fixture can use allocation/test-constructor hooks. Ordinary font/UI release builds omit that test-hook flag.
From the font source's test/coretext-host, install dependencies and build both darwin-arm64 and darwin-amd64. The drawing host and all its integration source are tracked here; no generated project outside the repository is required.
To use the shared Linux process/resource guard, run from this repository:
sigil scripts/macos/check.sgl FONT WINDOW ZIG HEADERS RESOURCE_ROOT CPUS NICE MEMORY_BYTES FREE_BYTES SCRATCH_BYTES TIMEOUT_SECONDS ACTION [EXTRA]The actions are objects, loader-model, caller-error (EXTRA is a matching Linux runtime archive), ownership-model (also takes that archive), font-arm64, font-amd64 and drawing. Linux-build, linux-unicode and linux-conformance use font's tracked test/freetype-host. The check delegates the first three to font's own gate and builds integration packages for the rest. Every child inherits the supplied affinity, priority and address limit; the shared monitor checks process-group RSS, free disk, owned build directories and deadline. Nested build directories are counted only once. RESOURCE_ROOT identifies additional owned build/cache scratch to count.
The optional full dependency object audit has the same arguments; use audit as ACTION and an installed registry source directory as EXTRA with scripts/macos/audit-native-groups.sgl. It compiles the selected locked FFI, crypto, TLS and SVG sources for both architectures. Then run:
sigil scripts/macos/verify.sgl FONT FONT_OBJECT_DIRECTORY NATIVE_AUDIT_DIRECTORYThis shares font's Mach-O parser and checks font, dependency/runtime objects and the real drawing image. Object proof does not replace a full application link or native Mac behavior.
Assemble the prebuilt packet using the independently accepted host packet:
sigil scripts/macos/prepare-qualification.sgl FONT HOST_PACKET HOST_MANIFEST_SHA256 OUTPUTRecord the resulting manifest hash independently. Transfer OUTPUT intact to an arm64 Mac and run:
sigil /absolute/packet/qualify.sgl /absolute/fresh/run-directory EXPECTED_MANIFEST_SHA256 --executeOmit --execute for a read-only plan. The script verifies the external manifest pin and each fixture's owner execute bit before creating any scratch. Assembly explicitly sets all six executables to mode 0755. The execute mode copies sources/fonts/bundles to fresh scratch, checks every copied input against the validated manifest, clears quarantine on its own copies, and directly executes each copied bundle executable once, retaining its real process exit status as well as its PID/hash/exit receipt. Host, conformance, WK adoption and initialization receive RUN only; font and drawing receive RUN RESOURCES. An exit before START reports its own error and actual process status, with pre-START stdout/stderr retained beside the native receipts. No compiler, package download or system font installation runs on the Mac. Process-only test registrations are cleaned up. Native results remain a release gate.
An individual fixture's behavior failure is recorded in fixture.failure, and the remaining independent fixtures still run, including drawing. The aggregate qualification.result lists every PASS/FAIL and the command fails if any fixture failed. Manifest or copied-input integrity failures remain fatal before launch.
The portable Unicode font suite must pass on Linux FreeType before sealing each packet. It uses the pinned cmap's U+1F800 supplementary outline and a small synthetic missing-outline admission case; an oversized system emoji file does not qualify outline refusal. The font CI also runs these portable cases.
For a Linux-only packet control run, use sigil scripts/macos/test-packet.sgl PACKET FRESH_ABSOLUTE_MODEL_DIRECTORY. It substitutes controlled OS tools, verifies valid/invalid plan behavior, and modifies a copied scratch executable to prove refusal before launch. Its logs are explicitly models; they never count as real Mac behavior. The shared check's packet action accepts those two paths after ACTION for the same run under the supplied resource limits. The font-only failure control also requires the subsequent drawing fixture to pass while the aggregate command remains a failure. The non-executable-fixture control changes only a fixture's mode to 0644, verifies that every content hash still matches, and requires the plan to refuse it without creating its destination.
The native drawing capture searches all content subviews for the host canvas. It converts known sRGB background/white colors into the bitmap's attached ICC colorSpace and compares raw getPixel components in that profile, handling alpha-first/last RGB layouts explicitly. The supported cache is 8-bit RGB(A). The background uses a two-level channel tolerance and must cover at least 75% of all pixels. Near-white coverage uses a 14-level tolerance around the profile-matched white and must reach 200 pixels. The capture logs colorSpaceName separately from the attached profile, expected device values, raw samples, dimensions, format and counts. colorAtX:y: is unsuitable here because its named calibrated RGB decode can differ from the attached display profile. The renderer's sRGB image path is unchanged.
Run sigil scripts/macos/test-fixture-arguments.sgl WINDOW FONT C_COMPILER FRESH_OUTPUT on Linux to test the launcher's shared argv against all six actual argument admission prefixes. The control compiles the native C main guards and evaluates the Sigil main admission forms, replacing only probe setup with a side-effect-free stub. It never invokes native Mac or drawing behavior. Use the shared check's arguments action with C_COMPILER and FRESH_OUTPUT for resource-guarded execution.