`make -C guest prebuilt-check` hashes guest/prebuilt and the sources it was
built from against guest/prebuilt/sources.toml, on any host, and fails
where the set reims-ctl embeds went stale. It runs beside the ROM's check,
since the library's checks would not reach a change to the wire header the
set is built against.
QEMU's reims-graphics-pci has no default option ROM, and reims-ctl is to
name one for every x86-64 VM on reims-vgpu's own device, on hosts that
build no firmware. firmware/prebuilt/ReimsGraphics.rom is the ROM `make -C
firmware prebuilt` builds on a Mac (Apple clang 21.0.0, Homebrew lld 23.1.4;
the bytes are the compiler's), and ReimsGraphics.toml records its sha256
and that of every file it was built from, the wire header among them.
`make -C firmware prebuilt-check` (firmware/prebuilt.sh --check) hashes the
ROM and those files against the record on any host, with no compiler, and
`cargo xtask check` runs it: the wire header is the library's, whose checks
would otherwise never see the ROM go stale.
rustdoc, on macOS and the Linux target, in public and private docs,
found 55 broken intra-doc links beside those of the commit before, and 8
redundant explicit ones. Each now names the item it means: a link to a
test-only helper, or to an item rustdoc cannot see from the doc or that
only another OS has, becomes the plain name; one to an item out of the
doc's scope takes its path; an ambiguous name takes its kind (a module,
or a function by its parentheses); and links to items gone name what the
code does now (the vaapi backend's frames are copied through read_back
and FrameReadBack::copy_to; the graphics decoder lets a message go at
end_message; the gate's waits and lane moves are their _offering forms,
the plain ones being the tests'). The links the ycbcr module made to an
'answer' that never resolved are dropped.
cargo xtask dist builds SDL again with the flags that give its classes the
library's names and keep its globals uncommon (-fno-common), for macOS 11.0.
Where the build runs through kache (dev-env.sh), kache serves a build
script's run from its store by the inputs Cargo reruns it for, and SDL's
script declares none of those flags, so a run of a build with no flags, from
any target directory on the host, was served in its place. A dev dist then
failed its archive check: SDL's _b_inModeTransition and _mach_base_info were
common symbols, left global, and its objects were built for the SDK's macOS
(measured on the M3 Max, after a dev test build had built SDL there).
dist's build now turns kache's build-script cache off with an [env] entry,
KACHE_BUILD_SCRIPT_CACHE=0, which the rustc wrapper and the scripts see, so
its build scripts run as without kache, and a run with the library's flags
is not served to another build either.
The guest's kext and option ROM are built in parallel and need the device's
wire format before the host side exists: its registers, the region's layout,
the rings' header and the control commands and events of the design's stage
2 wire protocol. They live in a new crate, reims-graphics, which will hold the
device's host side too, and cbindgen writes them into
include/reims_graphics_wire.h, which cargo xtask header --check keeps equal
to its output, as it does reims_vgpu.h.
Two fixes to the design's tables: a control ring's byte ring is 32 KiB, the
largest power of two after its 256-byte header in its 64 KiB (64 KiB less the
header is no power of two), and a pad's header is its type and size alone,
since the bytes left before a ring's end may be 8. A u64 that would follow a
u32 at an offset not a multiple of 8 has a reserved u32 before it, so C and
Rust lay the records out alike.
The owner asked for Rust's incremental cache and kache 2.0.0's. dev-env.sh
no longer sets CARGO_INCREMENTAL=0 or KACHE_ADAPTIVE_INCREMENTAL=0, and unsets
both where a shell kept them, and `cargo xtask check` runs its cargo steps in
the environment it starts in, so a check run again after a fix rebuilds what
the fix changed. Each host's kache configuration turns on adaptive and seeded
incremental state: kache compiles a unit being edited incrementally, and a
new worktree's first incremental compile of it imports a compatible one's
state (rustc 1.98 or later). docs/development.md says how, and that kache 2
compiles through its daemon, which builds now start.
Each worktree's check compiled everything again with full debuginfo and
incremental caches no rebuild used. The dev profile keeps line tables for
the workspace and none for its dependencies, the check builds without
incremental caches, and builds go through kache where it is installed, so
a worktree's first build reuses what another tree built, build scripts
included. Tests read the tree's paths at run time, so a build is the same
in every tree.
scripts/new-worktree.sh makes a worktree from clones of the main checkout's
suite files, and AGENTS.md says a profiling run removes its traces.
Source: 53a4a8edd b568f382e 0c7a0eabc 72c24f74b 10051ba78 8f415697a 73d557f71
bde4220b6 46c7c6b23
On x86-64 Linux and arm64 macOS the C API's crate makes jemalloc the global
allocator, so every Rust allocation in the library, metal2vulkan's runtime's
among them, goes through it. FIFO 1's commands allocate memory that the
runtime's threads free, and glibc refills its arena for each such block on
the allocating thread: on ms01's Iris Xe a Finder drag ran at 36 frames/s
under glibc and 42 with jemalloc preloaded into QEMU.
jemalloc's symbols stay prefixed, so QEMU's C code, the drivers and Apple's
frameworks keep the system's malloc. On macOS jemalloc is built with no
malloc zone (the workspace's cargo config), as its zone would otherwise
register ahead of the system's in every host that links the archive whole.
No block crosses between the two allocators: the suspend bytes the host is
handed go back through rvg_bytes_free, and the blocks the Metal platform
gives NSData and dispatch_data to free are malloc's own. Nothing the guest
or the host observes changes.
A Mac's `cargo xtask check` type-checks Linux with no Linux C toolchain, so
it points jemalloc's build script at an empty archive for that target, as it
leaves SDL unbuilt there: nothing links.
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.
Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.