Repository navigation
fix: Apple platform and FFI fixes from running a three.js app on Bloom - #176
Merged
proggeramlug merged 1 commit intoNov 6, 2026
Conversation
Found while running tuichess 3D (a three.js game compiled by Perry) on macOS, iOS, iPadOS and tvOS. - Camera clip planes: setCameraClipPlanes(near, far). begin_mode_3d used a fixed 0.01..1000, which at ~15 units from the camera resolves only about a millimetre of depth: surfaces 1 mm apart z-fought (made worse by TAA jitter). Changing the planes invalidates TAA history. - Perry string headers: Perry sets runtime-internal hint bits (JSON_ESCAPE_FREE, WTF8_VALIDATED, more in 0.5.1663: 0x1c is common on literals). They don't change the payload, so they are no longer treated as an ABI mismatch; only HAS_LONE_SURROGATES changes decoding. - createTextureRgba8: with alpha >= 128, `a << 24` is negative in JS and the u32 FFI slot saturated it to 0 (`>>> 0` keeps it unsigned). - Display scale and safe-area insets (getDisplayScale, getSafeAreaInset): iOS reports them every frame from the view's trait collection and safeAreaInsets; other platforms report 1 and 0 (display.rs). - Touch taps: iOS delivers touches on the UI thread, so a whole tap could start and end between two begin_frames and be lost; press/release are latched until the next frame. - tvOS: setMenuButtonExits(on) switches whether Menu leaves the app or reaches the game, as a game's top level does. - Jolt build cache: Apple simulators get their own cache (target ABI "sim"); a shared one handed simulator objects to a device link.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
proggeramlug
changed the base branch from
codex/docs-audit-fixes
to
codex/rendering-wip-integrated-20260727
November 6, 2026 15:47
proggeramlug
merged commit Nov 6, 2026
6164ad3
into
codex/rendering-wip-integrated-20260727
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #175. Found while running tuichess 3D, a three.js game compiled by Perry, on macOS, iOS, iPadOS and tvOS.
setCameraClipPlanes(near, far).begin_mode_3dused a fixed 0.01..1000, which at about 15 units from the camera resolves only about a millimetre of depth. Surfaces 1 mm apart z-fought, and TAA jitter made it worse. Changing the planes invalidates TAA history.HAS_LONE_SURROGATESchanges decoding.createTextureRgba8: with alpha >= 128,a << 24is negative in JS, and the u32 FFI slot saturated it to 0.>>> 0keeps the value unsigned.getDisplayScaleandgetSafeAreaInset. iOS reports them every frame from the trait collection andsafeAreaInsets. Other platforms report 1 and 0 (display.rs).begin_frames and be lost. Press and release are now latched until the next frame.setMenuButtonExits(on)switches whether Menu leaves the app or reaches the game.sim). A shared cache handed simulator objects to a device link.Tested:
cargo test --release --libinnative/shared(483 passed), and the macOS build. These changes ran in tuichess 3D on macOS, an iPad Pro and the iOS simulator.