fix(clay): unblock iOS-simulator build (bump zclay to Zig 0.16 + scalar hash guard) - #581
Conversation
… scalar hash) Bumps the zclay pin from `v0.2.2+0.14` (Zig 0.14 build API, fails to build on Zig 0.16 for ANY target — `Compile.addIncludePath` no longer exists) to johan0A/clay-zig-bindings `main` @ e0286c48, which ports zclay's build.zig to the Zig 0.16 API. This is the load-bearing half of the fix: it lets the Clay UI path compile again on the toolkit's Zig 0.16. Also hardens the actual iOS-simulator concern (labelle-cli#4): Clay's `Clay__HashData` uses aarch64 NEON intrinsics (`vdupq_n_u64`, ...) that under Zig 0.15.2 tripped `always_inline ... requires target feature 'altnzcv'` for the `aarch64-ios-simulator` triple. gui/clay/build.zig now detects that triple (`os.tag == .ios and abi == .simulator`) and defines `CLAY_DISABLE_SIMD` on the Clay C library compile (reached through the zclay module's link objects, since zclay compiles Clay internally), selecting Clay's fully-supported scalar hash path. Gated strictly on the simulator; device/desktop keep native SIMD. Mirrors labelle-box2d's `BOX2D_DISABLE_SIMD` pattern. Verified: host `zig build` green; `zig build -Dtarget=aarch64-ios-simulator` green; forcing a compile-only test of the gui module for the simulator triple compiles+links Clay's C for aarch64-ios-simulator without the NEON error (both with and without the guard on Zig 0.16 — the guard is defensive/ belt-and-suspenders), and a configure-time probe confirms the guard reaches the real "clay" compile step for the simulator target only. Closes labelle-toolkit/labelle-cli#4 Claude-Session: https://claude.ai/code/session_017pW3ifKf9wgxNg4viy6okw
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the zclay dependency in gui/clay/build.zig.zon and adds a workaround in gui/clay/build.zig to disable SIMD (using the CLAY_DISABLE_SIMD macro) when targeting the iOS simulator to prevent compilation failures. The feedback recommends updating the .minimum_zig_version in build.zig.zon to "0.16.0" to align with the requirements of the updated zclay dependency and avoid compatibility issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -5,8 +5,8 @@ | |||
| .minimum_zig_version = "0.15.2", | |||
There was a problem hiding this comment.
Since the zclay dependency has been bumped to a version that specifically targets and requires Zig 0.16, and the toolkit itself is running on Zig 0.16, the .minimum_zig_version should be updated to "0.16.0" to prevent compatibility issues and accurately reflect the toolchain requirements.
.minimum_zig_version = "0.16.0",
What
Unblocks the Clay UI half of labelle-toolkit/labelle-cli#4 (iOS Simulator: Clay UI fails to compile due to ARM NEON intrinsics).
1. Bump the zclay pin (the load-bearing fix)
gui/clay/build.zig.zonpinned zclayv0.2.2+0.14, which uses the Zig 0.14 build API (Compile.addIncludePath) and fails to build on the toolkit's Zig 0.16 for any target — so the Clay iOS path couldn't even be exercised. Repinned to johan0A/clay-zig-bindingsmain@e0286c488a303b93501944ccde10730cc74ecd58(commitd54ee9dd "update to zig 0.16"), which ports zclay'sbuild.zigto Zig 0.16.zclay-0.2.2-Ej1rkP3RAACYZGzQB5NGPaqfySgKfO26NYk5Ja6Z15gCgui/clay/src/adapter.zig) needed no source changes — zclay's public API is unchanged across the bump.2. iOS-simulator NEON guard (the actual #4)
Clay's
Clay__HashDatauses aarch64 NEON intrinsics (vdupq_n_u64, ...). Under Zig 0.15.2 this trippedalways_inline function 'vdupq_n_u64' requires target feature 'altnzcv'for theaarch64-ios-simulatortriple.gui/clay/build.zignow detects that triple (os.tag == .ios and abi == .simulator) and definesCLAY_DISABLE_SIMDon the Clay C library compile, selecting Clay's fully-supported scalar hash path.Because zclay compiles Clay internally (static lib
clay, not exposed as an artifact), the macro is applied by reaching that Compile step through the zclay module's link objects. Gated strictly on the simulator triple; device/desktop keep native SIMD. Mirrors labelle-box2d'sBOX2D_DISABLE_SIMDpattern.Verification
zig build(gui/clay) — green.zig build -Dtarget=aarch64-ios-simulator— green.guimodule foraarch64-ios-simulator: Clay's C library compiles and links for the simulator triple with no NEON error.claycompile step for the simulator target only (not host).Key finding
On Zig 0.16 the original NEON error no longer reproduces through the build graph even without the guard — the intrinsic-feature mismatch was a Zig-0.15.2-era problem, so the zclay bump alone restores the simulator compile. The
CLAY_DISABLE_SIMDguard is retained as correctly-targeted, low-risk hardening (scalar path only ever affects the simulator, where hashing perf is irrelevant) that pins Clay to the scalar path on the exact triple that failed, guarding against future CPU-baseline/Zig regressions.Closes labelle-toolkit/labelle-cli#4
https://claude.ai/code/session_017pW3ifKf9wgxNg4viy6okw