#!/bin/bash # The manual walk of a display's window on macOS: every entry of # crates/reims-vgpu-window/features.md up to "On Linux", plus the refresh # rate on a ProMotion screen, on boots of an arm64 macOS guest with the # reims-graphics device on Ambrosia under HVF (docs/qemu.md, "arm64 guests"), # at the Mac, in an unlocked session. About 15 minutes. It walks SDL3's window # by default; IMPL=appkit walks AppKit's, to compare. # # scripts/internal/walk_window_macos.sh VM_DIR # # VM_DIR is an arm64 guest that logs in by itself, as # firmware/ambrosia/check-boot.sh takes one: disk.img, aux.img.trimmed (or # aux.img, which a trimmed copy is made of) and vm.toml, whose ecid is the # guest's ECID. Each boot runs on fresh APFS clones of its disks under OUT, so # the guest itself is never written; each clone is deleted when its boot # ends, and OUT (the logs) at the end unless KEEP=1. The guest boots as # check-boot.sh boots it, with 8 GiB and 4 CPUs, Ambrosia, our configuration # bundle and reims-graphics-pci, and with the library's window open: QEMU runs # under -display none, and the device's display opens its window. # # Each step says what to do and what should happen; answer with Enter or p # (as described), f (not as described: a note is asked for), or s (skipped: # a reason is asked for). Steps a unit test already holds say so, and only # need a look. The script measures what it can itself: the guest's present # rate (the display's flips to the surfaces the guest presents, which the # library logs at debug as reims_vgpu::graphics::shown), the screen's refresh # rate, screendump, and QEMU's exit. The results go to RESULTS, printed at the # end; send that file. # # Environment: # AMBROSIA Ambrosia's image (no default): its target/ambrosia.bin, or a # release's ambrosia.bin, one that boots the guest (docs/qemu.md, # "arm64 guests: the boot check of our configuration") # BUNDLE the configuration bundle with our arm64e kexts (default # firmware/ambrosia/build/Config.cpio), as docs/qemu.md makes it: # make -C firmware/ambrosia config-bundle \ # GRAFT=$PWD/guest/prebuilt-arm64e/Graft-arm64e.kext \ # REIMS_GRAPHICS=$PWD/guest/prebuilt-arm64e/ReimsGraphics.kext \ # RGFXGATE=$PWD/guest/prebuilt-arm64e/RgfxGate.kext # QEMU qemu-system-aarch64 with reims-graphics-pci on this checkout's # library (default build/qemu-aarch64's, configured as # docs/qemu.md's "arm64 guests: the device on Ambrosia" says) # IMPL sdl (default) or appkit: REIMS_VGPU_WINDOW_IMPL # OUT the clones, logs and results (default /tmp/rvg-walk-