checkpoint: P5.6 macOS bundling via default_pipeline + 0125 fix done; remaining iOS/Android validation

This commit is contained in:
agra
2026-06-19 15:32:39 +03:00
parent 48eb7bf48a
commit a91b6e8ae0

View File

@@ -431,6 +431,29 @@ when reached (sentinels or accessor fns; see the design doc Risks).
`List` growth; orthogonal, see `current/CHECKPOINT-METATYPE.md`.)
## Log
- **P5.6 (macOS path) — `default_pipeline` drives bundling; fix issue 0125 (2026-06-19).** `build.sx` now
`#import`s `platform/bundle.sx` and `default_pipeline` delegates to `bundle_main` when `bundle_path()` is set
(emit+link via the shared `emit_and_link` core, then wrap the `.app`/`.apk`); else just emit+link. **Removed the
Zig `--bundle`/`post_link_module` dispatch shim** (main.zig) — CLI bundle flags only feed `BuildConfig`,
`default_pipeline` branches on `bundle_path()`. **USER DECISION:** import the bundler directly (it's
`abi(.compiler)`, emit-skipped, never in the binary; the build↔bundle import cycle resolves like std↔build) —
NOT a registration slot. **Validated end-to-end on macOS** (the stream's top-risk gap — bundler had ZERO
coverage): `sx build --bundle App.app --bundle-id … plain.sx` AND auto-bundle from `set_bundle_path` both produce
a valid SIGNED `.app` (correct `Contents/MacOS/` layout, Info.plist, passes `codesign`, binary runs). Fixed a
pre-existing host-build bug: `target_triple` was empty for host builds → `is_macos()` false → wrong flat layout;
main.zig now exposes the host triple (`LLVMGetDefaultTargetTriple`) when `--target` is absent. `bundle_main`
dropped its redundant `build_options()` re-fetch (uses its `opts` param). **Fix issue 0125** (surfaced because
the bundler's `format("…{}…")` instantiates `any_to_string`, which over-materialized array types): the type-match
dispatcher (`lowerRuntimeDispatchCall`) unboxed each interned array tag to the concrete array type (whole-array
load) → LLVM scalarized to one DAG node/element (~12s / segfault at `[65536]u8`). Fix (route 1): `case array:`
arm calls `slice_to_string`, dispatcher builds a `{ptr,len}` slice VIEW of the payload pointer (`unbox_any →
[*]elem` = int-to-ptr, NO load) for an ARRAY tag bound to a SLICE param. Output byte-identical (`[a, b, c]`);
0055 drops 12s→0.2s. Pinned `examples/0056-basic-large-array-format-no-blowup.sx`; issue 0125 marked RESOLVED.
37 `.ir` regenerated (bundler types + array-format lowering); `.ir`-only. **705/0 both gates** (`48eb7bf`).
> **REMAINING P5.6 / next:** iOS-device / iOS-sim / Android paths in `bundle_main` exist + now run on the VM (the
> `shr` port let them through) but are NOT validated on this host (no iOS/Android SDK + no corpus bundle harness)
> — that's P5.8 (build `m3te`/`distribution` end-to-end + add `.app`/`.apk` corpus smoke tests). Then P5.7 (delete
> `#compiler`/`compiler_call`/`compiler_hooks`/`interp.zig` + the legacy fallback; VM becomes the sole evaluator).
- **P5.6 prerequisite — bitwise/shift ops ported into the VM (2026-06-19).** `comptime_vm` exec now handles
`bit_and`/`bit_or`/`bit_xor`/`bit_not`/`shl`/`shr` (new `bitwise` helper next to `arith`), mirroring the legacy
interp's i64 model EXACTLY: shift amount clamps to `@min(rhs, 63)`, `shr` is an ARITHMETIC right shift