Since 110b53637 nothing in production makes a host-OS surface: the
reims-graphics device's surfaces reach the Vulkan platform as buffers, and a
texture over a surface's plane is made with new_texture_over_surface_plane.
Only tests made IOSurfaces, and the previous commit moved those onto that
creator.
So the platform's surfaces go: the Surfaces trait and Platform::surfaces,
GpuDevice::new_buffer_on_surface and new_texture_on_surface, the resources'
iosurface getters, the OS modules (os/surface.rs, os/linux/surface.rs,
os/macos/iosurface.rs) and the testkit's counted surfaces. With them goes
what only an object over an OS surface reached:
- metal_space's surface ranges and Over::Surface/Over::Plane;
- backing.rs's surface aliases (Alias, gather_or_nil, its zeros);
- writes.rs's bound-memory and slot-writes queries, and encode_render's
Reach and binds, which decided the refused writes of 523 and 527 into a
texture over a surface, with the compute pipelines' kept descriptors that
only those queries read (a render pipeline keeps its guest descriptor,
which its encoders read);
- predication's dropped texel writes, and the message layer's fatal_send;
- allocate_zeros, TWINS_READ_ONLY and an import's second making on Linux.
The measured facts the live path relies on stay, in the live modules' docs:
metal_space's (the surfaces' address ranges Metal gives), ycbcr.rs's
("Writes": which YCbCr writes Metal stores, drops, or changes by a rule the
runtime does not hold) and resource.rs's (the plane Metal asserts or answers
nil at). out_of_host_memory is Linux's alone now, as only Linux's views and
imports run out of memory short of Metal. docs/architecture.md,
development.md and qemu.md no longer describe the OS surfaces.
Nothing the guest or host observes changes, as no production path has made
an OS surface since 110b53637.
run_vmapple.sh booted a Virtualization.framework guest on vmapple with
apple-gfx and AVPBooter, all three gone: make qemu builds no aarch64 QEMU,
apple-gfx left the library and QEMU, and AVPBooter no longer boots on
vmapple's layout. vm_drive.py ran its tours through it, and vm_ocr.swift
served vm_drive.py alone. The window's walk, their last user, boots on
Ambrosia since ea18b7f17; arm64 guests boot as docs/qemu.md, "arm64
guests", says.
Every build, test, boot and copy on the shared machines has run as a
potluck job since 11-05, and the job's lease is the lock: --gpu holds a
GPU, --exclusive gives a timing run the whole machine. gpu-locks.sh and
metal2vulkan's maclock took lock files potluck never sees, so a run under
them could still share a GPU with a potluck job.
AGENTS.md, the boot section of docs/qemu.md, the video checks, the cost
benches' docs and the oracle README now name potluck's lease. The
conformance scripts take no lock of their own, and lane-gate runs its
tests under its job's lease. A build holds no GPU: it builds in a job
without --gpu, and the tests run in the same workspace holding one.
reims-vgpu-core is folded into reims-vgpu-vulkan, so the docs, the
manifests' comments and the crate descriptions that named the crate name
its module now: the crate lists and graph, seven crates, core's files under
crates/reims-vgpu-vulkan/src/core, the testkit feature, and what the x86-64
leg runs. The design note that put the decoder in core says where it is,
reims-vgpu's graphics::decode, and the path of a deleted file goes. The
kache measurement keeps the crate's name, as it was measured then.
The Vulkan crate is the library's only platform since the Metal platform
went, and every crate that links core links the Vulkan crate too, so core
needs no crate of its own. Its files move unchanged under
reims_vgpu_vulkan::core (crate::core in the Vulkan crate), the module the
video crate's layout already uses; its #[macro_export] macros stay at the
crate's root, so reims_vgpu_core::metal_check! is reims_vgpu_vulkan's now.
core's lint set is the module's inner attributes, as it was the crate's.
Nothing the guest or the host observes changes, and reims_vgpu.h is the
same. Core's log lines name reims_vgpu_vulkan::core:: as their target in
place of reims_vgpu_core::, so reims-ctl's example filter says so.
The testkit feature is the Vulkan crate's, reims-vgpu-vulkan/testkit, and
the crate's integration tests turn it on through a dev-dependency on the
crate itself, as core's dependents turned core's on. core's tests keep
their paths below core:: in the Vulkan crate's unit tests, and cargo xtask
check's x86_64-apple-darwin leg runs those alone: -p reims-vgpu-vulkan
--lib -E 'test(/^core::/)'. The tests that run themselves again in a child
name themselves below core:: too (a child given a name that matches no
test runs nothing and passes), and the memory map's tests take the lines
of the targets below reims_vgpu_vulkan::core::memory.
The macOS test that declares _exit now declares it safe, as the testkit
does: rustc's clashing_extern_declarations compares the declarations
within one crate.
The crate that holds the reims-graphics device's wire and transport now
carries the library's prefix, as reims-vgpu-video does: its directory is
crates/reims-vgpu-graphics, its package reims-vgpu-graphics, and its Rust
path and log target reims_vgpu_graphics. The guest's, the option ROM's and
Ambrosia's Makefiles include the wire header from the new directory, and the
prebuilt records name it there.
Nothing changes for the guest or the host. The device keeps its name
(reims-graphics, QEMU's reims-graphics-pci, PCI 1234:5247), and the wire
header keeps its file name and RGFX_ symbols. The C API header is unchanged,
and the prebuilt kexts and option ROM are byte-identical; only the records'
paths and source hashes move. A log filter names the crate's lines by its
new target (REIMS_VGPU_LOG=info,reims_vgpu_graphics=trace), a diagnostic.
The module is a new piece of the repository, so the layout, the
architecture and the checks a change to it needs name it: architecture
11.5 says what it does and how it is linked, and AGENTS.md gives a change
to it a build and an arm64 guest's boot on Ambrosia.
docs/qemu.md says how a qemu-system-aarch64 with the device is configured,
which make qemu does not build, how a guest boots with the module, and what
the boots measured on the M3 Max: the console on the device, SSH with SIP
enabled and no boot arguments, the BARs where the module put them, and the
HVF assertion that the device's scanout dirty log, before 7aee20f4, hits.
The Metal platform is gone (the commit before): AGENTS.md, README.md and the
docs now say the library carries out the guest's calls on the Vulkan
platform, on Linux and on a Mac over MoltenVK for development and tests;
that the display's shaders live in the Vulkan crate; that `cargo xtask
dist` writes target/dist-vulkan on every OS; and that the tests of the
Vulkan platform compare with Metal's recorded answers. architecture.md's
section 4.6 describes the answer layer and the macOS message layer in
place of the metal crate's. conventions.md keeps "core changes as little as
the Vulkan and Linux work allows" without its reason, the Metal product.
The host's video was five crates: core, codec, conformance, and the VA-API
and NVIDIA backends, with the examples and tools split between two of them.
One device uses them, from one library. They become one crate,
crates/reims-vgpu-video, with the modules core, codec, vaapi and nvidia, the
last two built on Linux alone. The conformance readers and writers, which only
the examples use, stay a crate of their own beside it, at
crates/reims-vgpu-video/conformance (reims-vgpu-video-conformance). The files
move with git mv, their paths rewritten, with no re-exports left behind. The
NVIDIA examples build on every host, as a stub off Linux.
Dead code goes with them: NVDEC's VP9 path and the codecs nothing asks it for
(NvdecCodec is H.264 and HEVC), and the Vulkan platform's listing of the
host's GPUs (host_gpus::hardware_gpus and gpu_device_gpu), which nothing
called, with its serde_json dependency.
AGENTS.md, development.md, docs/video and the nextest filter name the one
crate.
testing.md was the behaviour-lock suite's specification and the paravirt
guest ABI; it now says how the code is tested and keeps the Tags convention.
development.md's layout, tests and commands, conventions.md's examples and
the lessons and accuracy-ledger entries that cited the paravirt device, its
FIFOs or QEMU sections that are gone now describe the code there is.
On Linux the Vulkan platform is the library's only one, yet reims-vgpu and
reims-vgpu-c refused to build without their `vulkan` features (a
compile_error!), and the code behind it did not compile either: a
default-feature Linux build of the package failed. A crate that does not
build in a feature setting is a failure, so the platform is now unconditional
on Linux.
- reims-vgpu's new build script sets `cfg(vulkan_platform)` on Linux, and on
macOS with the `vulkan` feature, declared for check-cfg. Every
`feature = "vulkan"` gate in the crate is that cfg; the gates of "macOS or
the feature", true on every target the library builds for, are gone.
- The Vulkan platform's dependencies are not optional on Linux; on macOS they
stay the feature's, optional, so the Mac's default build is as before.
- reims-vgpu-c makes every handle on VulkanPlatform on Linux whatever its
features; the compile_error!s go.
Behaviour is unchanged on both OSes: on macOS every cfg answers as the
feature did, and on Linux as the builds with the feature did. The docs and
comments that said Linux needs the feature say it no longer does.
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.
kache 2 seeds a worktree's incremental state from another worktree's only
when both targets sit inside their worktrees: it maps the compiler's working
directory to one path, and a target elsewhere puts a path of its own in the
compiler's arguments. Measured on the M3 Max: with targets inside the
worktrees, a second worktree's first edit of core compiled in 4.3 s from the
first's state, against 7.0 s with no donor; with each target in its own
directory under ~/.cache, the seed identities differed and it took 5.7 s.
So a worktree, which lives under ~/.cache, now builds in its own target/
with no CARGO_TARGET_DIR. Also rewraps a line of the previous commit.
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.
scripts/ mixed the one script a person installing reims-ctl runs,
install-ctl.sh, with eight that only developing the project runs: the worktree
and build environment, the GPU locks, the VM boot and tour drivers, the window
walk and the IOSurface qtest. Those move to scripts/internal, so scripts/ holds
what users run. run_vmapple.sh, walk_window_macos.sh and vm_drive.py find the
repository from their own path, one level deeper now; every reference in the
docs, the Makefile, the video crates' tools and the code's comments follows.
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
A new x86-64 VM needed an OpenCore image and an installer made by hand with
OSX-KVM or ULTMOS. reims-ctl now runs reims-util for both: pick a macOS
version (n in the interface, create --macos on the command line) and it
downloads the installer from Apple, makes the VM's OpenCore image with OVMF
and a Mac identity of its own, and makes the disk.
- create --macos VERSION downloads Apple's recovery image (about 1 GB), or
with --offline an installer of one release (13 to 20 GB). Installers are
kept in the data directory's installers for the next VM, one reims-util at
a time writes there, and a stopped download continues. The download comes
before the VM's directory, so stopping it leaves no VM half made, and
reims-util ends with reims-ctl on Linux. What create is given (a disk, an
installer, an OpenCore image and the OVMF beside it, reims-util itself) is
checked before the download and the disk's copy, and the VM list is read
again before the VM joins it, so VMs made or deleted during a download
stay as they are.
- --opencore is optional: without it reims-util makes the image, with the
VM's MAC as its ROM, and an iMacPro1,1 for macOS 10.13 and 10.14. An image
of the user's brings OVMF_CODE.fd and OVMF_VARS.fd beside it, as
reims-util writes them.
- The interface's form asks where macOS comes from, the version first; with
no name, the VM takes the version's, skipping names a VM or a leftover
directory has. A VM with an installer says in its details, and create
prints, how to install macOS from it; one made from a disk is reminded to
set Metal's error mode.
- A new disk needs an installer or a download: a VM of an empty disk and no
installer is refused.
- Every installer attaches as a read-only disk (snapshot=on), a DMG
converted to a raw image in the VM's directory, so the CD drive is gone: a
change of installer applies at the next start. vm.toml's installer_kind
is no longer written, and is ignored where an older vm.toml has it. A
missing installer says how to eject it.
- reims-ctl __record-install, which scripts/install-ctl.sh runs last,
installs reims-util at the commit reims_util.rs pins, so the update that
brings this reims-ctl installs it too, though it runs the script it
started with. doctor checks for it in place of the system's OVMF, and the
install no longer adds the ovmf or edk2-ovmf package.
- vm.max_map_count: a new VM's default of up to 16 GiB needs about 1.13
million mappings, more than the 1048576 suggested (CachyOS's stock
value). The README, the install script, doctor and the start warning
suggest 2097152, which covers 30 GiB, and check against what the VM, the
largest VM or a new one's default needs.
- Updating from the interface while a create runs says the restart stops
it, as quitting does.
Dropped, as reims-util's images leave nothing for them to cover:
- create --from-script and the interface's launch-script import, which read
OSX-KVM's and ULTMOS's QEMU scripts. A VM made from one keeps working; its
vm.toml names its own copies.
- The search for OVMF beside a user's OpenCore image in those projects'
layouts, QEMU's edk2 build and the distributions' packages, and
--firmware-code and --firmware-vars.
- create --disk-mode overlay: copy, a reflink where the file system can, or
in-place covers an existing disk. A VM made with an overlay keeps working.
- --cpu-model and --cpu-flags on create and set, and the edit form's CPU
fields: new VMs take Skylake-Client-noTSX-IBRS. vm.toml keeps cpu_model
and cpu_flags, so an older VM keeps its model; docs/qemu.md says how to
change it there.
- --installer's --iso and --cdrom aliases.
README, the help and the docs no longer point at OSX-KVM or ULTMOS. README
step 3 describes reims-util's OpenCore picker (5 seconds, which an arrow key
stops, measured on homelab-ms01), and architecture.md 11.4 counts its image
among those that keep AvoidRuntimeDefrag on.
The README now speaks to people running VMs through reims-ctl. The repository
layout, the tests and the Rust library's crates, commands, profiles and
features move to docs/development.md, which the README's Developing section,
AGENTS.md and the docs that cited those sections now point to. The QEMU and VM
section is gone (docs/qemu.md covers it), as are History, whose tags AGENTS.md
now names itself, and the interoperability note under Legal.