AtlatestRepositorysigil-ui

sigil-ui / tree / docsmacos-qualification.md

Read it rendered

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