Reference
Limits
Sizes, budgets and timeouts to design around.
Design within these limits from the start. Most problems with new apps come from going over one of them.
Package
| Item | Limit |
|---|---|
| App file | One HTML file, under 2 MB |
| Glasses module | WebAssembly 1.0, up to 128 KB |
| Memory | Exactly one 64 KiB page as both minimum and maximum, including an 8 KiB stack |
| Name | 1 to 31 printable ASCII characters, the same in the manifest and the Rust code |
Runtime
| Item | Limit |
|---|---|
| Callbacks | 500,000 instructions per call to app_init, app_render, app_event or app_stop |
| Not available | WASI, threads, SIMD, bulk memory, reference types, a start section, and files or sockets on the glasses |
Drawing
Per frame. Several budgets are shared with MIRA’s own interface, so leave headroom.
| Item | Limit |
|---|---|
| Canvas | 640 × 480, 16 gray levels |
| Drawing calls | 512, shared with MIRA’s interface |
| Text calls | 64, shared with MIRA’s interface |
| Image calls | 64, with up to 131,072 image pixels in total |
| 4-bit image memory | 32 KiB, shared with MIRA’s interface |
| 1-bit masks | Up to 32 × 32 each, 16 slots shared with MIRA’s interface |
A call that doesn’t fit a budget is skipped rather than drawn partly.
Messaging
| Item | Limit |
|---|---|
| Phone to glasses | 3,500 bytes of JSON per message |
| Glasses to phone | 4,096 bytes of JSON per message |
| Realtime | 380-byte scenes to the glasses, 379-byte controls back |
| Phone requests | 8 in flight, 384-byte payloads, 8-second timeout |
Phone companion
| Item | Limit |
|---|---|
| Network | 10 MB request and response bodies, 8 requests at a time |
| Microphone | 16 kHz mono, 16-bit samples, in frames of about 100 to 256 ms. At most 256 ms waits while your page is busy. |