Files
reims-vgpu/docs/testing.md
T
Anees Iqbal 8c40add9ac 📝 Say what the tree runs on now the old platform is gone [ci skip]
The cutdel branch deletes VulkanPlatform, metal2vulkan-runtime and the rt
feature, so RtPlatform over metal2vulkan-rt is the only platform. These
docs still described the old one: its answer policies, its exact
switches, MoltenVK on the Mac, its in-place guest memory, its records
cache, its device recovery and its Metal-answer tests.

- conventions.md: the guest-memory-in-place rule is replaced by the rt
  rule (rt allocates GPU memory, the device maps its blocks into the
  guest, textures sync at the guest's events, and there is one VkDevice
  per process). The degradation codes are now rt-unbuilt and rt-refused,
  and the deleted codes are dropped.
- accuracy-ledger.md: restated for rt, which has no switches. It keeps
  the device's own arithmetic notes (tagged as measured before rt), the
  19 unbuilt pieces and rt's refusal kinds, and device loss.
- api.md, README.md: REIMS_VGPU_EXACT, _CENSUS_DIR and _TRACE_DEGRADE
  are gone, and STRICT now covers running out of memory only. The let-go
  and the quiesce describe one platform.
- architecture.md, development.md, testing.md, qemu.md: KosmicKrisp in
  place of MoltenVK; RtPlatform, rt_window and RtBlocks in place of
  VulkanPlatform, the old window sink and HostBlocks; no Metal-answer
  comparisons and no opt-in GPU-fault tests.
- lessons.md: the four lessons about deleted code only (the Metal
  comparison after MoltenVK, the runtime's shadows, device recovery and
  the in-place check) are dropped. The lessons that still bind mark
  their deleted names.
- video/vaapi.md, graphics-kext/design.md: the GPU plane copy and the
  compositor mirror are marked as gone.
- AGENTS.md: only the Vulkan platform's "Where things are" row changes.
2026-11-20 07:08:46 -08:00

3.4 KiB

Testing

How the code is tested, and how a claim about Metal or the hardware says where it comes from. AGENTS.md, "Checking a change", says which of these checks a change runs.

The tests

  • Unit tests sit beside the code, in mod tests, named by the behaviour they hold. cargo xtask check runs every one with cargo-nextest, and the doc-tests.
  • Core's testkit (core::testkit, the Vulkan crate's testkit feature) is a fake Platform that models Metal's objects and logs the calls whose order Metal observes (architecture.md 13.2). Core's tests, and the tests of other crates that need no GPU, run on it.
  • The Vulkan platform's tests run on an rt device of the host's GPU, strict (architecture.md 13.3). Metal's answer is the reference: where this platform answers otherwise on purpose, the test says so and accuracy-ledger.md has the row. No test reads answers recorded from Metal. The tests that need an rt device and are ignored on macOS say why in their ignore reason.
  • The C API's tests (crates/reims-vgpu-c/tests): its exports, and a host in C built against the committed header and linked with the shared library.
  • The wire's header (crates/reims-vgpu-graphics/tests/header.rs) compiles as the guest's kext and option ROM compile it, as C11 and as C++17 with no warning, its records laid out as wire's.
  • The host video backends have hardware tests and conformance runs of their own (video/).
  • The guest's kexts and Metal bundle have their tests (make -C guest test, on a Mac). cargo xtask check also runs the records of the prebuilt kext sets, x86-64 and arm64e (make -C guest prebuilt-check) and of the option ROM (make -C firmware prebuilt-check), which fail when the committed binaries are stale.
  • VM boots are the only check of what a guest's frameworks choose from the device's answers, of a death every boot reaches, and of QEMU's side of the C API (qemu.md, "Booting a guest to check a change").

A test of an odd behaviour, one that guests may rely on, names the behaviour. Changing what it holds is a change of behaviour, made on purpose in a commit of its own that says why.

Tests that disturb the host

Every process on a Mac shares its GPU, and a test that faults the GPU fails the work of every other process there, the desktop's included (lessons.md). The tree holds no test that faults the GPU or reserves most of its memory on purpose; one added would be opt-in (#[ignore]), run only for a change to what it tests, with --run-ignored only, first and alone (.config/nextest.toml). A GPU test can still fail beside GPU work or heavy load elsewhere on the host; one that passes run again alone is not a failure.

Tags

A claim about Metal, a driver or the hardware is tagged:

  • measured: run, and the text says how, on which host and OS;
  • read: from the code, ours or a driver's;
  • cited: from an external source, named where it is used;
  • unknown: not established.

An honest unknown is worth more than a plausible guess, for the reason AGENTS.md gives for names: a wrong claim attaches the wrong meaning to the right code, and nothing flags it. A claim that the hardware cannot do something is checked against the driver (its format features and extensions) before it is relayed.