Files
reims-vgpu/scripts
Anees Iqbal 4fdd3d6efc observe, env: make the layering below the device a fact the compiler checks
Component: crates/reims-vgpu (observe, env, contract, runtime) plus the new
crates/reims-vgpu-env and crates/reims-vgpu-observe. Pathway: all three.
Structural; no guest-visible behavior and no rail-specific term.

Contract: the catalogue's F0 item asks for a backend-neutral vocabulary — a
protocol layer that can name a refusal without naming a backend, with
observability and configuration extracted as behaviour-free support beneath it.
`observe`'s own module doc already made the claim in prose ("the sink must sit
somewhere `translate/` and `caps/` can name their reason type without depending
on `runtime/`"), and nothing checked it: every module in one crate can reach
every other, so the direction held only as a habit.

Owner: the crate graph. Behaviour changed: none at runtime. `env.rs` becomes
`reims-vgpu-env`, and `observe`'s sink, decline vocabulary, `Emit` builder, slug
registry, driver watch, footprint and phase clock become `reims-vgpu-observe`.
Both are re-exported under the paths callers already write — `crate::env::…`,
`crate::observe::fail(…)`, `crate::observe::Decline` — so no call site moves. A
layering change that also rewrote three hundred call sites would be two changes
reviewed as one.

`ladder` and `panic` stay in `reims-vgpu`: both name `runtime` types, which is
precisely the dependency the split is drawing a line under.

The split immediately produced one thing prose could not. `contract::gva_resolve`
carried `impl Refusal for ResolveStatus`, with both the trait and the type now
foreign to `reims-vgpu` — an orphan-rule error, and an honest statement that
`reims-vgpu-paging`'s walk status and `reims-vgpu-observe`'s vocabulary meet in
neither crate. It is now `walk_refusal(&ResolveStatus) -> Option<&'static str>`
with the same twelve slugs, and `MemError::slug` delegates to it exactly as it
delegated to the impl.

Test-only surface: `FailCapture`, `fail_log_path`, `forget_all_latches` and the
slug-collision panic are used by tests compiled separately from the crate that
defines them, so they are gated on `any(test, feature = "testing")` and
`reims-vgpu` turns the feature on from `[dev-dependencies]`. Verified that the
shipping artifact does not: `cargo tree -e features` shows `testing` only under
dev-dependencies, and the release staticlib contains `/tmp/reims-vgpu-fail.log`
once and no per-pid test path, so the background writer and the flood detector
are the ones that ship. The writer's flood machinery is `cfg`'d to the
configurations that use it rather than given an `allow(dead_code)`.

Test: no new behaviour, so no new regression test. The existing suite is the
evidence, and the counts are the claim: 2332 tests before the move, 2274 in
`reims-vgpu` plus 45 in `reims-vgpu-observe` plus 13 in `reims-vgpu-env` after —
the same 2332, none dropped or silently cfg'd out. `scripts/feature-matrix`
gains a support-crates cell so a future module move does not read as the
emptied-arm loss its own warning is about.

Verified: `cargo test -p reims-vgpu --no-default-features
--features backend-vulkan,host-window -- --test-threads=1` (2274 + 97, 0
failed); `cargo test -p reims-vgpu-env -p reims-vgpu-observe -p
reims-vgpu-paging -- --test-threads=1` (13 + 45 + 36, 0 failed); all three main
clippy arms plus `-p reims-vgpu-observe --features testing` and the bare arm,
all with `-D warnings`; `scripts/feature-matrix/feature-matrix.sh` all cells
PASS; `cargo fmt --all` and `--check`; the rustdoc link pass, which loses nine
pre-existing unresolved links and adds none; a release staticlib build.

Not verified: no VM boot and no conformance battery were run.
`reims-vgpu-wire`'s oracle-fixture tests fail 12 cases when the gitignored
fixtures are present. That is inherited debt, not this change: the same 12 fail
identically on the parent, run from a separate worktree with
`REIMS_WIRE_FIXTURES_DIR` pointed at the same fixtures. Nothing here touches
that crate.
2026-08-31 14:37:26 +03:00
..
2026-08-30 23:38:42 +03:00
2026-08-30 23:38:42 +03:00
2026-08-30 23:38:42 +03:00