-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Safari Compatibility #823
Comments
I thought of this bug when I read the last paragraph in
|
When it comes to UI we actually doing diverse testing, which includes different desktop operating systems like macOS/Windows/Linux, different mobile OS like iOS/iPadOS/Android, different browsers (Chrome, Firefox, Safari), etc.. Speaking of issue itself, an |
Hi @bkase ! Could you (or anyone who knows) please add steps to reproduce? (and any updates / insights / hypotheses from the past month) Which combos of iOS / Safari have problems? Which don't? Which simulators work, and which don't, and what exactly happens? Will anyone be assigned to this issue soon? Thanks! |
I think @shimkiv has found these issues and might be able to help with reproducing? |
@ryancwalsh, I was able to create it the following way, for my test project
When accessing |
@nicc have pushed this up the backlog for next sprint. |
@jdsteinhauser are you sure that Safari on iOS emulator won't do the same for any simple html+js you mentioned? Like they might prevent consequent alerts spawning by default for instance. |
Another interesting finding is that SnarkyJS won't work on WebKit built from sources. It was discovered by using Playwright's webkit installed by |
I haven't tried SnarkyJS alone without a framework in Safari on iOS |
@jasongitmail I actually talking about any simple html + js alerts. |
you tagged the wrong Jason :P |
hehehe sorry for that :) |
@shimkiv Ah, I gotcha now. Sorry for the confusion! Yes, I can get alert modals to show up with plain html/js on an iPhone emulator |
After some exploration, I successfully made a SnarkyJS build operate with Safari on iOS. The critical adjustment involves modifying the requested WebAssembly memory within a particular function, which can be found at this link: https://github.com/o1-labs/snarkyjs-bindings/blob/9948427f992545da1f6919fa5d4445437da751d9/compiled/web_bindings/plonk_wasm.js#LL7746C77-L7746C90 Through experimentation, I discovered that the memory error ceases to occur by reducing the Here is an example: imports.wbg.memory = maybe_memory || new WebAssembly.Memory({initial:19,maximum:16384,shared:true}); The current memory size is 4 GiB (65536 pages). This seems to be fine for Chrome but for iOS, there might be issues with that size. It's worth noting that doubling the memory to The implications of reducing the memory are unclear to me now - it could lead to downstream issues. One possible solution could be to perform a browser check and exclusively reduce memory for iOS agents if there is no issue of lowering memory. @mitschabaude, what kind of errors (if any) could occur from lowering the maximum memory requested from 4GiB to 1GiB? Finally, the requested memory is used to load the |
Awesome find @MartinMinkov! The Wasm memory limit should be as large as possible - it's the constraining factor for circuit size. So I'd be in favor of detecting iOS browsers, maybe we can look at 'navigator.userAgent' |
@MartinMinkov I think we can create the memory in 'initSnarkyJS()', with limits depending on the user agent, and then pass it to the init() function ourselves |
Another potential issue I considered is that there might also be memory differences between iOS devices. I was testing an iPad Pro running iOS version |
I confirmed that 1GiB of memory also works for an iPhone SE running |
The new iOS Safari release supports nested web worker spawning, and SnarkyJS with Safari on desktop seems to work; however, iOS Safari SnarkyJS does not seem to according to some internal testing by @shimkiv
Observed behavior is that something is breaking during SnarkyJS load-time, isReady never resolves and nothing prints.
Note that this does work on an iOS simulator.
We believe this is just a matter of working through the errors one by one until it works! It would be a great first issue for a contributor as you'll step through different parts of SnarkyJS trying to dig through errors.
The text was updated successfully, but these errors were encountered: