Commit Graph
3239 Commits
Author SHA1 Message Date
Anees Iqbal 3e08ec00cb 🆕 Let reims-ctl update follow the stable or development channel
An update pulled whatever branch the checkout had, so moving to the
development branch, or back to master, meant going into git by hand.
reims-ctl update --channel stable|development now checks out master or
development before the install script runs. A checkout that lacks the
branch fetches it and tracks the remote's, adding the branch to a
single-branch clone's refspecs so the pull can follow it. The checked-out
branch is the channel, so later updates stay on it. The switch comes
before the script starts, so the script that runs is the new branch's own.

doctor says which channel the checkout follows. The interface's update
dialog says it too, and offers a switch to the other channel beside
Update.
2026-10-11 22:43:35 +03:00
Anees Iqbal 7480029913 🆕 Show examples in reims-ctl create --help
The help listed every option but not how they combine. It now ends with
an example for each way a VM is made: an x86-64 guest from a disk with
macOS installed, from the installer onto a new disk, or from an OSX-KVM
or ULTMOS launch script, and an arm64 guest from an IPSW or from a
macosvm or tart VM. The header takes clap's own style, so it matches
Options: on a terminal.
2026-10-11 22:41:12 +03:00
Anees Iqbal e17d3c2460 🎨 Record the lock against a local metal2vulkan checkout
A [patch] in a .cargo/config.toml above the checkout points metal2vulkan
at a local tree, which drops the three git source lines from Cargo.lock.
Committing that keeps the owner's tree clean while the patch is active.
Without the patch, cargo writes the lines back from the pinned rev, and the
lock regenerates byte for byte as before; --locked builds need the patch or
a regenerated lock.
2026-10-11 22:33:09 +03:00
Anees Iqbal 2c6261b637 🔥 Revert the refusal of GPUs that import no shared memory
This reverts commit f6fcaf5f4. It shipped a refusal of AMD GPUs and a README
line saying they cannot run guests yet while the owner had still to decide
how the project answers AMD hosts (a dma-buf import of guest RAM through
udmabuf, or the refusal). The probe, measured on the UM780 (RADV refuses a
shared memfd page, NVIDIA and llvmpipe import it), stays in f6fcaf5f4 for
whichever way is chosen.
2026-10-11 22:31:51 +03:00
Anees Iqbal 341a38bd92 📝 Rewrite the README's opening in plain language [ci skip]
The beta notice and getting started read like a spec, and the notice framed the
repository as reims-ctl. reims-vgpu is the virtual GPU; QEMU and reims-ctl ship
alongside it. Say so, and say what a user brings and what was tested, in words
a person would use.
2026-10-11 22:14:36 +03:00
Anees Iqbal caa3ee9165 ⬆️ Bump qemu 2026-10-11 22:12:36 +03:00
Anees Iqbal 2624fe619b 📝 Move the README's developer reference to docs/development.md [ci skip]
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.
2026-10-11 22:10:39 +03:00
Anees Iqbal d9c2933e82 📝 Put the x86-64 Linux guest first in getting started [ci skip]
The Linux host with an x86-64 guest is the pathway to lead with, so its steps
now come before the Apple silicon ones.
2026-10-11 22:06:17 +03:00
Anees Iqbal e64f670f99 Merge branch 'development' into steelbrain/ctl-shared-memory-probe 2026-10-11 22:05:40 +03:00
Anees Iqbal 571b5f32f7 📝 Lead the README with getting started [ci skip]
Readers who run VMs reach the install steps right after the screenshots. The
pathways table follows getting started, the paragraph on what reims-vgpu
replaces opens Developing, and the call for contributors is gone.
2026-10-11 22:05:26 +03:00
Anees Iqbal f6fcaf5f44 🆕 Refuse GPUs whose driver imports no shared memory
A user's macOS 15 guest died on every boot on an AMD host (RX 7600 and
760M, RADV, Mesa 26.2.4) at the library's first import of guest RAM:
newBufferWithBytesNoCopy: refused with Unsupported { HostMemory,
NotRepresentable }. Guest RAM on Linux is a shared mapping of a memfd, and
libdrm's amdgpu_create_bo_from_user_mem asks the kernel for anonymous
memory only (AMDGPU_GEM_USERPTR_ANONONLY), which amdgpu refuses for any
mapping with a file behind it (read from libdrm's and the kernel's code;
metal2vulkan's host_memory.rs measured the refusal on RADV). No AMD GPU on
Linux can run a guest.

reims-ctl's Vulkan probe now asks each driver to import a page of a shared
memfd mapping through VK_EXT_external_memory_hosts, as the library does. A
start refuses a GPU that refused it, naming why and whether another GPU of
the host can run the guest, instead of booting into the death; reims-ctl
gpus, doctor, the bug report and the TUI mark such GPUs. A probe that
could not ask leaves the GPU as it was.
2026-10-11 22:03:43 +03:00
Anees Iqbal 6ebf462388 📝 Shorten the README's line on what reims-vgpu replaces [ci skip]
The intro named the library and its C API, which readers running VMs through
reims-ctl do not need; saying it replaces Apple's framework is enough.
2026-10-11 21:59:29 +03:00
Anees Iqbal 9a772d8869 📝 Point the README's beta notice at reims-ctl [ci skip]
The project now serves people who run VMs through reims-ctl, not hosts linking
the library, so the notice speaks to them and no longer cites the C API.
2026-10-11 21:58:34 +03:00
Anees Iqbal a543fc246a 📝 Mark the project beta in the README [ci skip]
The C API has largely stabilized and changes only by addition; what remains
is platform- and driver-specific differences. The alpha callout described a
research-quality project, which no longer fits.
2026-10-11 21:56:44 +03:00
Anees Iqbal 528824d23f 🔥 Hardcode the SMC key in reims-ctl and drop --osk
Every x86-64 VM now gets isa-applesmc with Apple's SMC key, so there is
nothing to set: --osk is gone from create and set, and so are the TUI's
"Apple SMC key" fields, the info line and the key read from a launch
script. A vm.toml that still holds an osk loads as before; the value is
ignored.
2026-10-11 21:36:21 +03:00
Anees Iqbal d21f973d73 📝 Restore the old README's layout on the new tree [ci skip]
The README written for libreims_vgpu opened with the library's internals and
read as a reference for its developers. The one before it (69a57dd69) led
with what the project is for, an alpha notice, screenshots, the host/guest
pathways and a step-by-step start, and was easier to come to cold.

Bring that layout back with this tree's facts: QEMU's apple-gfx devices on
the library's C API, reims-ctl as the way to make and boot VMs on each
pathway, the window's capture and release chords as features.md lists them,
the environment variables docs/api.md section 2 lists, and the dual license.
The developer sections (Requirements, Building, Dist, Features, History) stay,
after the user-facing ones, under the names AGENTS.md and the docs cite. The
screenshots come back from the same commit.
2026-10-11 20:39:27 +03:00
Anees Iqbal 98fe2a3bd5 🆕 Replace the tree with libreims_vgpu and its C API
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.
2026-10-11 20:27:17 +03:00
Anees Iqbal 69a57dd69a Merge pull request #75 from steelbrain-bot/steelbrain/v6-backports
v6 backport deletions
2026-09-03 23:29:26 +03:00
Anees Iqbal aa07715a6c 🔥 Remove outdated bits in AGENTS.md 2026-09-03 23:25:01 +03:00
Anees IqbalandClaude Opus 5 a925b13f92 dead: the directory the cutover was reading from, deleted wholesale
The 2026-09-02 amendment replaced Seam 6's "delete the legacy counterpart" with
"disconnect it", and it always ended in this commit: `dead/` is deleted whole,
in one commit, once the groups have moved. The packet-class groups have moved —
`Namespace` and `RefResolver` are the sole name authority, the ingress switch is
cut, `ingress::Gap` is down to two variants and `packet_class_unclassified` is
zero on both driven rails — and the one item left on the disconnect list is not
a packet class at all. It is the process-global mutable engine behind
`static ENGINE: Lazy<Mutex<EngineState>>`, and its legacy files leave the tree
with it when it wires, not through a staging directory.

Removed, all of it unreachable by construction already:

- `crates/reims-vgpu/src/dead/` — eight files, ~344 KB of legacy Rust
  (`blit_decoder`, `compute_decoder`, `render_decoder` and its tests,
  `stream_framer`, `event_decoder`, `child_deprecated_ops`, `pending_stamp`),
  and the 159 KB register that recorded what moved, the structural-zero
  scoreboard, and the live-validation table.
- `crates/reims-vgpu/tests/dead_is_unreachable_by_construction.rs`. Its own
  `every_dead_directory_carries_its_register` says the suite goes when the last
  `dead/` does, and there is nothing left for its six doors to guard. What goes
  with it is the check that the register's 63 named functions still exist; every
  one of them was verified present in live source before the delete, so the
  claims it was standing behind are true at the moment it stops asking.

The coverage the gate held is now held by the rule instead: a group's legacy
tests die with its legacy source, so the commit that wires a group names the
owner-level tests replacing them in its message. `AGENTS.md` and the plan's
Seam 6 say that rather than the disconnect procedure, and neither offers `dead/`
as a place to stage a deletion through.

Three call sites pointed at the register for a number rather than for code —
`vm/README.md` and `vm/drive-desktop.sh` for the workload every rate was taken
behind, and `runtime::drain` for the stamp counter read at zero when the
publication point moved — and each now carries the fact instead of the pointer.

Verified: `cargo check --workspace --all-targets --no-default-features
--features reims-vgpu/backend-vulkan` clean (three pre-existing warnings in
`queue_owner.rs`, which are `host-window`-gated consumers, not dead code);
`dispatch_agrees_with_the_packet_ledger` passes, being the one test that reads
`runtime/drain/mod.rs` as text; `cargo fmt --check` clean. No guest-visible
behavior changes — nothing deleted was compiled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RrJpWZWCYaxKdLk4oQk3h
2026-09-03 23:12:14 +03:00
Anees IqbalandClaude Opus 5 a96c8d6fe3 usage: the row was pointing at a gap that does not exist, and the census says so
`8eb3f585` named IR dataflow over the SPIR-V as the next move, for "a device
buffer whose read-versus-write the translator's facade does not carry". That was
built — a ~400-line analyser in `reims-vgpu-vulkan`, nine tests, wired through
both publish sites — and it is **not** in this commit, because the boot that was
supposed to confirm it refuted it instead.

`buffer_direction_from_module=0`, and so are the other three outcomes of the
lookup, on a boot where the analyser demonstrably ran. No `ResourceKind::Buffer`
binding this guest declares has `access: None`. The scoreboard's claim was read
off an **older revision** of the translator's own doc; the pinned revision
populates buffer access "from Metal's declared access and tightened by
specialized-entry parameter attributes", which is the narrowing the pass was
written to add. A pass that answers a question nothing asks is a linear scan per
pipeline build that can only ever delete edges, so it is reverted rather than
kept against a future guest that might need it — that is Hypothesis-grade, and
the plan says a hypothesis may not control implementation.

What is kept is the instrument, because it is what found this. Two new
participation-weighted rows finish `UsageCensus`, and they are weighted the way
the ordering plane weighs them rather than by draws: one conceded slot in a
pipeline that draws ten thousand times is ten thousand conflicting
participations, and one unpublished pipeline that draws twice is four.

Driven macos-15 x86/Vulkan boot, `reims-vgpu-pci`, three rounds, `FAIL=0` across
40 777 lines, `unknown=9 375  read=331 995  write=10 383  read_write=12 800`
(2.6 %), and the split is decisive:

- **`unknown_from_a_table=0`.** Not one `Unknown` comes from a published
  `BindingUsage`. Every table this device publishes is already as narrow as the
  reflection can make it, so no publisher-side work can move this row further.
- **`unknown_with_no_table=3 589`** is the structural population: the packet that
  first names a pipeline draws against it, and `pipeline_leases` is that same
  packet's walk output, so the walk precedes the declaration it produces.
- **The remaining 5 786 are neither.** They are participations the records
  themselves declare, not slots an encoder bound; they never pass through a
  `BindingUsage` and no reflection can reach them. That is a different
  subsystem, and `dead/README.md` now says so instead of pointing at buffers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 22:45:17 +03:00
Anees IqbalandClaude Opus 5 8eb3f58541 usage: the residue gets a census, and 81 % of it turns out to be one thing
The previous commit left the access-mode row at 3.2 % and a guess about what was
in it. The scoreboard's own argument is that a guess and a measurement look the
same from outside, so this measures.

`reims_vgpu_core::exec::UsageCensus` is filled at the one place the answer is
decided — `EncoderBindings::footprint_into` — and carried on the `ExecWork`
beside the accesses it describes, so it cannot report a different walk than the
one that ran. Four draw rows, three dispatch rows, and the first pipeline that
answered nothing, so the device can ask the table what state that pipeline is in.

Two hypotheses died on the first boot. `draw_usage_no_pipeline=0`: the walk
always knows which pipeline a draw binds. `draw_usage_one_stage=0`: a pipeline
publishes both render stages or neither. What is left is
`draw_usage_no_stage=1 241` against `draw_usage_both_stages=72 447`, and the
per-slot line names it: **88 of 93 first sightings read
`model_pipeline=unleased`**.

`unleased` is the table answering "I have never heard of this pipeline", and it
is structural rather than a race. `pipeline_leases` is the walk's *own output* —
the packet's bytes are what declare the pipeline — so the walk necessarily runs
before the declaration it produces, and a pipeline is bound and drawn in the same
packet that first names it. Closing that would mean re-walking a parked packet
after its pipelines go `Ready`, which is a real option (nothing has executed
while it is parked) but changes what an already-admitted ordering position
depends on. Not a change to make for 1.7 % of draws without the model saying it
is sound. Written down as structural at this seam.

`publish_render_usage` moves the render publish into the pre-scan, where compute
already publishes. **It bought nothing measurable** — 1 244 to 1 241, which is
noise — and it is kept for the four `model_pipeline=ready` sightings rather than
for that: a lease the model called `Ready` with no usage published is exactly the
hazard `publish_pipeline_usage`'s publish-before-ready rule exists for, and the
pre-scan is the only site in front of `ready_lease`, so it is where the rule
holds structurally instead of by accident of which site ran first.
`pipeline_usage_published` on the model is the single arbiter, so the two sites
cannot both enumerate a binding set. Measured cost: preflight 10.5 to 11.4
us/call, 0.50 s over a 422 s boot, unchanged in absolute total.

Driven macos-15 x86/Vulkan boots, `reims-vgpu-pci`, three rounds each, `FAIL=0`
across 40 663 and 41 449 lines, 25 distinct refusal reasons:

    unknown=9 579  read=319 318  write=10 221  read_write=13 174   -> 2.7 %

against 3.2 % the commit before and 3.9 % render-only. Of the 9 579, about 1 200
are the structural first-packet population and the other **~8 000 are one
thing**: a device buffer whose read-versus-write the translator's facade does not
carry. It needs IR dataflow over the SPIR-V the rail already holds, which the
plan assigns to the executor that compiled the shader. That is the next move,
and `dead/README.md` and the journal carry the sketch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 22:12:31 +03:00
Anees IqbalandClaude Opus 5 24a5e47b5b usage: the compute rail publishes too, and a wildcard stops hiding six kinds
The producer the access-mode row named as the half that was missing: "the
compute rail, which publishes nothing yet". `binding_usage::compute` turns a
translated kernel's reflection into a `PublishedUsage`, and the compute pre-scan
publishes it.

**The pre-scan and not the dispatch.** The walk asks for a pipeline's reflection
once, at admission, so a transaction that leases a kernel before its usage lands
carries `Unknown` for every slot for its whole life. `compute_exec::vulkan` runs
after the transaction is released and is therefore too late to be the answer it
was admitted on. `preflight_compute_translations` already holds the AIR and runs
before admission readies the packet's leases, so it is the earliest site there
is — earlier, in fact, than the render rail's.

Three things had to move for that to hold:

`declare_pipeline` now runs *before* the rail pre-scans. `publish_usage` refuses
a pipeline the table does not hold, so publishing from the pre-scan would have
been declined on exactly the packet that first builds the kernel. The step is
the guest's own fact and the walk's own list; taking it earlier states the same
thing at the first moment it is known.

`PipelineTable::usage_published` is the memo, because the pre-scan reaches every
dispatch of every packet and enumerating a binding set allocates. It is the
model's record rather than a set beside the rail: `withdraw`, `refuse`,
`retire`, `device_lost` and `compact` all drop the published usage, and a
rail-side memo would go on claiming a pipeline was covered after its answer had
been thrown away.

**The wildcard was hiding six kinds.** The first driven boot came back with
`binding_usage_unknown_kind=48`, and `_ => UnknownKind` could not say which kind
those were. The pinned translator declares sixteen `ResourceKind` variants
against the ten this module named. Reading each settled them:

- `SynthesizedNullTexture` / `SynthesizedReadSampler` sit at the first binding
  in their band that no Metal resource claims, so their index cannot be a guest
  slot and skipping them is exactly true. These were the 48.
- `EmbeddedArgBufferBuffer` and `BufferAddressTable` are invented indices, like
  `EmbeddedArgBufferTexture` — `SyntheticIndex`.
- `PrimitiveAccelerationStructure`, `VisibleFunctionTable` and
  `IntersectionFunctionTable` occupy a buffer index whose guest-side resource
  class this mapping does not model — a new `AuthoredObject`.
- `KernelStageInput` gets its own reason, because it is the one with a known way
  to close it. It is the vertex fetch's problem in compute form: Metal supplies
  stage-input data through buffer-table slots the *pipeline descriptor* selects,
  while the reflection's index for the kind is allocated as the lowest slot the
  kernel's own buffers leave free. Publishing would call the guest's real slot
  unreferenced and delete a read edge, so the stage refuses whole. The compute
  stage-input descriptor is what closes it, and this device decodes it already.

With every variant named the `_` arm is unreachable, so it and `UnknownKind` are
deleted. A translator that grows a kind now fails to compile here rather than
quietly answering `Unknown` for it.

Driven macos-15 x86/Vulkan boot, `reims-vgpu-pci`, three rounds to `workload
done`, **185 434 draws**, zero FAIL across 39 927 lines, 25 distinct refusal
reasons against the previous boot's 24:

    access_mode_unknown      11 632
    access_mode_read        332 370
    access_mode_write        10 439
    access_mode_read_write   12 692

3.2 % unknown, against 3.9 % when only the render rail published. Every refusal
this mapping can report reads zero — all four `binding_usage_*` — with
`pipeline_usage_published=154`, `pipeline_usage_unnamed=0`,
`compute_usage_translation_lost=0` and `compute_usage_already_published=190`,
which is the memo firing. Zero refusals with nothing unnamed is what says the
reading is the whole population rather than a sample.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 21:30:50 +03:00
Anees Iqbal 8fb4e67a94 Merge pull request #74 from steelbrain-bot/steelbrain/v6-backports
More v6 backports + partial cutover
2026-09-03 20:52:56 +03:00
Anees IqbalandClaude Opus 5 b44e94cfe4 usage: the render rail publishes what its shaders read, and 81 % becomes 3.9 %
The producer the previous commit's door was waiting for. `binding_usage` turns
one translated stage's reflection into a `BindingUsage`, and
`pipeline_resolve::ready` publishes both stages before the `Ready` step that
lets a transaction lease the pipeline.

Driven macos-15 x86/Vulkan boot, three rounds to `workload done`, zero FAIL
across 24 130 lines, 145 819 draws:

    access_mode_unknown    342 987  ->  10 686
    access_mode_read        59 641  -> 246 093
    access_mode_write        9 866  ->   6 886
    access_mode_read_write  11 609  ->   7 492

Two different things moved. About 150 000 participations stopped existing —
a slot the shader does not reference contributes nothing — and of what remains
96 % now names a direction rather than conflicting with everything.

`pipeline_usage_published=137`, with `pipeline_usage_declined`,
`pipeline_usage_unnamed` and all three `binding_usage_*` refusals at zero, so
every render pipeline this guest built published both stages and the reading
is not a sample.

Two things this had to get right, both of which delete edges when wrong:

A stage is published whole or not at all. `BindingUsage` reads a slot past its
table as *unreferenced*, which is only true if the whole binding set was
enumerated — so an unhandled kind, a synthesized index or an out-of-range slot
refuses the stage and leaves it `Unknown`, rather than skipping the binding.

The vertex fetch is not in the reflection and still reads. A `[[stage_in]]`
shader names no `[[buffer(n)]]` for what the fixed-function fetch pulls; the
vertex descriptor does, and the translator lowers it to input attributes. From
the reflection alone every vertex buffer would read back "unreferenced" and a
write to one would stop being ordered before the draw. The vertex stage's
table is the union with `VertexBindPlan::attribute_slots`.

The boot's refusal histogram is the same shape as the one before it — 24
distinct reasons against 24, same top four, one gone and one arrived at a
single line each. That is the check a change that only removes ordering edges
needs, because a missing edge shows as a wrong frame rather than as a line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:50:41 +03:00
Anees IqbalandClaude Opus 5 89be2cbfd6 usage: the model gets the door its 81 % was waiting on
`AccessMode::Unknown` exists so the census can say how much ordering is bought
by not knowing. The first boot that asked came back at 81 %, and the reason was
one line: `ExecWork::footprint_into` passed `None` for the pipeline's
`BindingUsage` because nothing in the tree could construct one, so every bound
slot of every draw and dispatch conflicted with everything.

`PipelineTable` now holds what an executor publishes. `publish_usage` is the
door; `PublishedUsage` states each stage separately as an `Option`, because
"published, references nothing" and "not published" are opposite answers — the
first drops the participation and the second keeps it `Unknown` — and a type
that collapsed them would turn an unreflected pipeline into a draw with no
footprint at all.

The reflection dies with the build it described: `retire`, `refuse`,
`withdraw`, `device_lost` and `generation_closed` each drop it, and a compile
finishing after the guest's delete is refused rather than resurrecting a name.
fn `a_reflection_dies_with_the_build_it_described` walks all five doors.

`ExecBuilder` carries the source rather than taking it per record, so a
packet's records cannot be resolved against two different answers, and the
walk reaches it through `UsageSource` so it does not depend on where the table
lives. `NoUsage` is the conservative answer spelled as a statement.

The device holds the lock for exactly one packet's walk —
`DeviceState::pipeline_usage`, taken and dropped by `device_packet` — because
the walk asks once per bound slot and a lock per slot would put the ordering
plane's mutex on the hottest path here. Safe to hold across it: the namespaces
and the access source are the `lifecycle` owner's, a different lock.

Nothing publishes yet, so no boot's numbers move on this commit. The producer
is the next one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:38:30 +03:00
Anees IqbalandClaude Opus 5 fe571c15e0 zeros: the scoreboard's two blanks get numbers, and one of them is 81 %
Driven macos-15 x86/Vulkan boot at `40748306`, three open/quit rounds to
`workload done`, zero FAIL lines across 39 215, 164 129 draws.

Re-scans of already resolved EXEC bytes: **met.** `exec_stream_framed=18 421`
against `exec_streams_loaded=18 421`, a ratio of exactly one. Every
submission on this boot carried a single stream, so the boot cannot separate
"once per stream" from "once per submission" — the off-VM gate is what does,
and it also holds the plan step to framing none.

Supported operations reaching an unknown access-mode fallback: **not met, and
it is most of the ordering.** `access_mode_unknown=342 987` against 81 116
known — 81 % of every access the dependency graph ordered against, about 2.1
per draw. The cause is one line: `ExecWork::footprint_into` passes `None` for
the pipeline's `BindingUsage` and nothing in the tree constructs one, so every
bound slot of every draw and dispatch is `Unknown`. The reflection exists;
this rail already computes it to build descriptor layouts. That row is what
the table's own argument was for — it read as a plausible zero for as long as
nobody counted.

The stage half is split out as its own row and stays unmeasured for a stated
structural reason: its instrument lives in a module the engine does not use.

The run ended on `boot-x86.sh`'s 420 s cap rather than on a SIGTERM, so the
script printed its wedge banner; the row says so, and says the drive had
finished three minutes earlier with the census still flowing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:27:48 +03:00
Anees IqbalandClaude Opus 5 4074830648 zeros: the two unmeasured rows get the instruments they were missing
Seam 6's scoreboard carries two "not measured here" rows, and neither was
unmeasured because the property was hard to state. Both were unmeasured
because nothing counted.

Re-scans of already resolved EXEC bytes. The violation's shape on this rail
was two pre-scans walking every stream through the same framer before
execution walked it again, so the segment census read three times the truth.
`walk_stream` is now the one place this crate frames an exec stream and it
says so — `exec_stream_framed`, against a new `exec_streams_loaded`
denominator, so a boot's ratio is the reading. Off the VM the gate is
`a_submission_frames_each_stream_once_and_preflight_frames_none`: two
streams, framed twice, and the plan step frames none because it answers from
`ExecWork` rather than from the packet's bytes. Confirmed it bites by
framing once inside the plan step.

Supported operations reaching an unknown access-mode fallback. `AccessMode`
has carried `Unknown` as a variant distinct from `ReadWrite` since it was
written, on the argument that the census has to be able to say how much
ordering is bought by not knowing — and no census did. `note_access_modes`
counts an admitted packet's intents by mode at the door the dependency graph
takes them through. The gate prices an invalidate and a discard, which have
the same shape and different modes, so a census bucketing by class would
fail it.

The stage half of that row stays unmeasured, and now for a stated reason:
`reims_vgpu_vulkan::barrier::BarrierPlan::unmapped_bits` is the instrument
for it and the engine does not use that module, so nothing on the live path
can report it. That is a cutover item, not a counter.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:13:20 +03:00
Anees IqbalandClaude Opus 5 d457751d1e dead: three more structural zeros stop being unknown, and one becomes a gate
The scoreboard shipped with six rows reading "not measured here", and its own
paragraph says why that is worth acting on: an unmeasured zero and a violated
one look the same from outside. Three of the six had an answer already sitting
in the boot's census.

**Host GPU waits for ordinary commands.** `ring_retire_blocks=0` and
`fence_timeouts=0` across 172 862 draws, with `readbacks=0`. The ring is the
only place a steady-state draw could take a wait — a wrapped ring waits the
slot's fence before reusing it — so zero there is the whole claim, and
`render_post_wait_skips=49 550` is the positive half saying the skip path ran.
This one also stops being a boot reading: both warm-draw gates now assert the
two deltas at zero, in the region that is already exactly one steady-state
draw.

**Wakeups whose scheduling unit is a draw.** `queue_async_submits=2 404` for
172 862 draws, equal to `batch_flushes` — the queue owner wakes once per batch.
Scoped honestly: only that thread is measured.

**Repeated transfers.** Met for buffers — `buffer_bind_reuses=304 017` and
`buffer_index_bind_reuses=892`, each a bind served from a copy the command
buffer already held. Not claimed for images, because `sampled_reuploads=45` are
lawful and nothing separates a lawful reupload from a repeated one.

Two rows still read "not measured here" and say so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:04:51 +03:00
Anees IqbalandClaude Opus 5 73412bf70e dead: the structural zeros get a scoreboard, and the gate reads it
Two things this file could not answer. Whether the interning boot happened,
and — more usefully to whoever picks this up — which of Seam 6's structural
zeros are actually met.

**The boot.** macos-15, x86/Vulkan, desktop reached, clean SIGTERM teardown,
zero `FAIL` across 23 735 log lines, 172 862 draws. The reading that is about
`155fe27b`/`158888b3` is `attr_sets=14`: fourteen distinct vertex-attribute
sets for a whole boot, flat across every window. That is the plateau the
unbounded object caches are justified by, measured on the newest of them, and
it is why the level was added to `object_cache_levels` rather than left
uncounted.

**The scoreboard.** The plan states fourteen required steady-state values and
says nothing about which hold, and a table of aspirations reads exactly like a
table of results. Six are met and say what establishes them; two are not met
and both are the same thing — the process-global engine mutex, with the census
atomics as the same blocker wearing a different hat, since sharding counters
behind a lock that already serialises draws buys nothing measurable. Six are
**not measured here**, and the column says so rather than implying a zero. Some
of those may well hold; the point is that nobody has asked, and this table's
own argument is that an unmeasured zero and a violated one look the same from
outside.

**The gate had to widen to keep the file honest.** It read ``fn `name` ``
claims only from the register's fifth column and from lines carrying the phrase
"replacement coverage" — so the scoreboard named four gates and the gate
verified none of them, while the rule above says every name in that form is
checked. It reads them anywhere on a line now. Verified by renaming a
scoreboard name and watching it fail, then restoring it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 20:03:29 +03:00
Anees IqbalandClaude Opus 5 158888b33c draw: attribute sets are interned too, and the gate draws like a guest
The previous commit's own doc named what its zero did not cover:
`PipelineKey::attrs` is a `Vec<AttrKey>` built per draw, and the fixture drew
without vertex attributes, so that vector was empty and an empty vector does
not allocate. A zero measured that way is a zero about a shape no guest sends
— the last boot bound 162 246 vertex slots.

Both halves are closed here. `SliceIntern<T>` is the interning half of
`LayoutTable` without the Vulkan handles: a digest picks the bucket, the
retained slice decides the hit, an id is an identity. `AttrsId` comes out of
it and `PipelineKey` carries that instead of the vector. The pipeline miss path
copies the attributes out of the table rather than borrowing them, because
every refusal on that path takes `&mut self` to record a negative entry — one
allocation on the path that is about to compile a pipeline.

And the gate now draws three attributes with their locations deliberately out
of binding order, so it pays the normalization a guest draw pays. Still **0
allocator trips, 0 bytes**. It also asserts the draw bound its three vertex
slots, beside the batch-join and no-flush assertions that were already there:
a zero is only about paths the draw took, and a fixture that quietly stopped
binding would report the same zero for the wrong reason.

`object_cache_levels` grows a seventh entry, `attr_sets`. The census line's own
doc is why that is not optional: these caches carry no capacity on the argument
that their population is the guest's distinct object set and settles, and the
level is the only thing that can falsify it. An unbounded table with no level
is what that doc warns about.

Verified: 2156 lib tests, 18 vk_engine_batch, 18 vk_engine_compute, 60
vk_engine_parity, all serial on a live device; clippy clean of new warnings.
A guest boot is owed, and covers this and `155fe27b` together.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:54:58 +03:00
Anees IqbalandClaude Opus 5 155fe27baf draw: layouts get an identity, and the descriptor draw reaches the zero
The last two allocations on the warm descriptor-bearing draw were one fact.
`LayoutKey` owned a `Vec<BindingSig>`, the layout cache was a
`HashMap<LayoutKey, _>` and could only be probed with one, and `PipelineKey`
carried the whole key by value — so every draw built that vector to look
something up and then cloned it to look something else up.

`LayoutId` replaces it: a `Copy` handle issued in order by `LayoutTable`, which
buckets by a digest of the bindings and **confirms against the bindings it
retains**. That is deliberately not a digest-as-identity. `digest`'s own module
header argues against one, and nothing here needs it — a bucket with two
entries is resolved by comparing, so two distinct binding sets can never share
an id and an id can only name a layout that exists.

Three things fall out of the table not being an `ObjectCache`:

* `get_or_create_layout` takes a **slice** and the draw's bindings live in the
  command buffer's graphics scratch, so the last per-draw list is gone too.
* It takes no `&mut ResourcePools`. The only thing the old signature used one
  for was disposing a layout an insert displaced, and a content lookup that
  missed cannot displace the entry it just failed to find. `DeferredHandle`'s
  `PipelineLayout` and `DescriptorSetLayout` variants went with it.
* `push_descriptors` travels in `ResolvedLayout` instead of being re-derived
  from the bindings at bind time. It is the flag the `VkDescriptorSetLayout`
  was *created* with; asking twice was two answers to one question.

**Warm repeat draw binding one storage buffer: 0 allocator trips, 0 bytes.**
The gate asserts that rather than a ceiling now, and asserts bytes with it,
because a trip count alone cannot say whether a zero is the path's or the
fixture's. Six went to zero in four steps and the test keeps the trace, since
what the six shared is the point.

What it still does not cover is stated in the test: `PipelineKey::attrs` is a
`Vec<AttrKey>` and this fixture draws without vertex attributes, so a real
guest draw — 162 246 vertex bind slots on the last boot — still pays one trip
this measurement cannot see. Interning attribute sets the way layouts are now
interned is what closes it.

Three unit tests, because the interning claim is not observable from a draw:
`two_layouts_sharing_a_digest_bucket_keep_separate_identities` forces the
collision the digest is allowed to have and the table is not,
`the_layout_front_does_not_answer_for_a_different_binding_set`, and
`a_layout_refusal_is_replayed_only_for_its_own_bindings`, which restates the
out-of-memory rule the layout table had to carry itself.

Verified: 2156 lib tests, 18 vk_engine_batch, 18 vk_engine_compute, 60
vk_engine_parity, 7 dead-gate, all serial on a live device; clippy clean of new
warnings. A guest boot is owed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:50:46 +03:00
Anees IqbalandClaude Opus 5 f819d51331 dead: the boot the three list removals owed
`5471721f` moves where a draw's vertex and storage binds live and replaces the
gather-role table with a scan over the request, so it owes a guest. macos-15
on the x86/Vulkan rail: desktop reached, host-driven workload, clean SIGTERM
teardown, **zero `FAIL` across 25 173 log lines**, 172 885 draws.

The row records the two readings that are about this change rather than about
the boot. `vertex_buffer_bind_slots=162 246` equal to
`vertex_buffer_bind_emitted` — the list moved into the command buffer's
scratch and those two being equal is what says nothing was dropped in the
move. And `buffer_guest_imports=158 028` binds through the three call sites
that `expect()` a gather-role classification, none of which returned `None`,
which is the whole of what the deleted table was consulted for.

It also records what the boot does *not* cover, because a zero is not evidence
until someone says which kind it is: `buffer_guest_gathers=0` and
`buffer_gather_declined=0` on this host, which imports every guest buffer
window directly. The role's byte columns were never written here, so the
scan's shared/vertex/storage split rests on its unit test and on a host
without pointer import.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:43:38 +03:00
Anees IqbalandClaude Opus 5 5471721f70 draw: the three per-draw lists that were the same mistake three times
Six allocations a warm repeat draw, down to two. All three closed here are one
shape: a list built fresh on every draw, for the length of one draw, out of
data the draw already had.

**`BufferGatherRoles` is gone entirely.** It has been three shapes in turn — an
ordered map, then a flat `Vec` scanned linearly, and now no table at all. Its
three call sites ask about a key they already hold, so scanning the
`DrawRequest` the table was *built from* is the same order of work on a
population of about six binds, minus the allocation and minus a second
structure that can disagree with the first. "Shared content stays one physical
operation" stops being an invariant a merge maintains and becomes a property of
the answer: both flags come back from one call because both loops can set them.
The test asserted that as a table length, which could only say the merge added
no entry; it asserts the answer now, and there is no length left to assert.

**The vertex-bind and storage-bind lists moved into the command buffer's
graphics scratch**, beside the push-descriptor list that was already there.
`bind_vertex_buffers` already claimed in its own doc that every array it
touches is reusable and the hot path allocates nothing — the caller's array was
the one that was not. `begin_*_binds` / `stage_*_bind` mean the list cannot
outlive the draw that filled it or be forgotten on a refusal, which a
take-and-return loaner would have allowed.

The storage list had to move *with* the descriptor list, not after it: the
descriptor list is derived from it, and a caller holding one from the pools and
the other as a local cannot hand both to one function without borrowing the
pools twice. `descriptor_scratch_and_storage_binds` returns them together off
one disjoint-field split.

Warm repeat draw binding one storage buffer: **6 -> 2 allocator trips, 32
bytes**. The test prints bytes now, and that is the check on its own trace
list: 32 over two is exactly the two `LayoutKey` allocations it names, so
nothing unlisted is hiding behind a number that only counts calls. Both
survivors are one fact — `PipelineKey` carries `LayoutKey` by value and
`LayoutKey` owns a `Vec<BindingSig>` — and closing them is a change to how
layouts are keyed. Ceiling moves to 2.

Verified: 2152 lib tests, 18 vk_engine_batch, 18 vk_engine_compute, 60
vk_engine_parity, all serial on a live device; clippy clean of new warnings.
A guest boot is owed and is taken next, since this moves what a draw binds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:38:08 +03:00
Anees IqbalandClaude Opus 5 b8111104ee dead: the boot the binding-table split owed
`191b06c9` changes what a draw hands `vkCmdPushDescriptorSetKHR` and when it
builds it, so it owes a guest. macos-15 on the x86/Vulkan rail, host-driven
workload, clean SIGTERM teardown, resident zero-copy present reached, **zero
`FAIL` across 19 776 log lines**.

The row records the split's own census rather than only the absence of
failures. 153 187 draws; `descriptor_pushes=34 423` against
`descriptor_push_held=9 018`, so 9 018 draws found the command buffer already
carrying their bindings — each of those used to build and drop a
`Vec<vk::DescriptorBufferInfo>` and a `Vec<vk::WriteDescriptorSet>` on the way
to sending neither. And `descriptor_set_updates=3` in a whole boot, which is
the reading that says the allocated-set arm is the exception and the push rail
is the one the measurement was about.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:34:33 +03:00
Anees IqbalandClaude Opus 5 191b06c9a1 draw: the binding table is not rebuilt for a draw that sends nothing
The warm repeat draw that binds one storage buffer built a
`Vec<vk::DescriptorBufferInfo>` and a `Vec<vk::WriteDescriptorSet>` every
time. It sent neither. The push-descriptor rail compares this draw's bindings
against what the command buffer already carries and records nothing when they
match, and that comparison happens two thousand lines after the write
structures are built — so on the measured ninth repeat, `descriptor_pushes`,
`descriptor_set_binds` and `descriptor_set_updates` were all zero while 280
bytes of Vulkan structures were assembled and dropped.

The test is what caught it: it now prints those three counters beside the trip
count, and three zeros next to two allocations is not a thing you argue with.

So the two representations are separated. The draw builds its bindings as
`PushDescriptorBinding` — this device's own vocabulary — into the command
buffer's existing scratch, which costs no allocation, and Vulkan's write
structures are derived from that list only by the consumer that actually sends
them: an allocated descriptor set, which is fresh from the pool and must be
written every draw, or a push whose comparison said it differs.

`with_descriptor_writes` takes a callback rather than returning the writes,
and that is not a style choice: `vk::WriteDescriptorSet<'a>` borrows the
`Descriptor*Info` beside it, the borrow is what stops a write outliving the
info it points at, and returning both would need a self-referential struct.
`PushDescriptorBinding::slot` gives the three fields both arms carry so the
translation matches on payload once instead of three times.

Warm repeat draw binding one storage buffer: **6 allocator trips -> 4**, and
the plan's "no full binding-table rebuild on an unchanged draw" is now true of
the host side and not only of the recording. The ceiling in the gate moves to
4 and the trace list names what is left.

Verified: 2152 lib tests, 18 vk_engine_batch, 18 vk_engine_compute, 60
vk_engine_parity, all serial on a live device; clippy clean of new warnings.
The suite needs `--test-threads=1` — in parallel this file fails two tests on
an unmodified HEAD as well, checked in a separate worktree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:28:39 +03:00
Anees IqbalandClaude Opus 5 9daf4f3858 present: the probe also rebuilds the swapchain from the wrong thread
Presenting is the frequent WSI call and recreating is the dangerous one:
`recreate_swapchain` destroys and rebuilds a `VkSwapchainKHR` against a
surface the compositor and the event loop both still own, and the probe as
landed held one geometry for its whole run, so it never ran that pair
off-thread. Its own doc named that as the second thing the move would have to
be right about, which is a caveat the probe was in a position to close rather
than record.

It now toggles the presenter's desired extent on a cadence, which arms
`recreate_pending` so the *next off-thread present* is the one that rebuilds.
Linux/Wayland, twenty seconds: 959 presents, 31 rebuilds, `busy` zero,
`failed` zero, empty failure log. Whether the requested extent is honoured is
not asserted and is not the claim — Wayland reports a `currentExtent` the
driver clamps to and the native window is never actually resized — the claim
is that the destroy/create pair ran on the wrong thread and the rail kept
presenting after it.

Verdict is now conditional on the rebuilds having happened, so a future change
that quietly stops arming them fails the probe instead of passing a weaker one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:22:06 +03:00
Anees IqbalandClaude Opus 5 7425feb42d present: the thread question the next move was going to have to guess at
`window_present_frame`'s docs record two readings taken before the present
becomes a device transaction — that the move would not change the schedule,
and that it would cost the drain about a millisecond a second — and then name
what was still open: the acquire has to precede the blit recording, and it is
the window's surface that owns the swapchain. Whether the platform's WSI
tolerates being driven from a thread that did not create that surface was not
established, and it is the one unknown that could turn the whole design into
an intermittent hang discovered on a live boot.

`examples/window_present_off_thread` asks that and nothing else. The event
loop opens the window exactly as a boot does, with a frame slot that is never
published to, so `needs_present` lets it present once and then goes quiet;
every present after that comes from another thread through the same entry.
Linux/Wayland, native ICD: 288 presents in six seconds and 960 in twenty,
`busy` zero and `failed` zero in both, empty failure log, and the window
thread's single first-frame present visible in the log exactly where the
probe's own model says it should be.

Recorded beside the two throughput readings, with what it does not cover:
MoltenVK acquires through `CAMetalLayer` and is a different implementation
with different thread rules, so the two Apple rows need their own run, and the
probe holds one geometry throughout so it says nothing about
`recreate_swapchain` racing the loop's resize handling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:20:41 +03:00
Anees IqbalandClaude Opus 5 ecb6ed3722 dead: the live-state section says what the thread survey found
The section's job is to be truer than the plan about where the cutover
actually is, and it had drifted twice. It still named `BLIT_FAIL_REASON` as a
blocker after `13f9aa49` removed it, and it said nothing about the two
per-operation thread violations closed since, which were not in the engine
and so were not where its reader would have looked.

Records what the survey covered as well as what it changed: the three
long-lived workers that remain are owners, and the plan says a dedicated owner
thread is not itself a defect. A next session that re-surveys `thread::spawn`
should find this instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:14:49 +03:00
Anees IqbalandClaude Opus 5 b0bb5b8a67 pipeline cache: persistence gets an owner instead of a thread per save
The second of the plan's per-operation thread violations, and the one it
names by subsystem: "lifecycle persistence is performed by the epoch owner
rather than a per-save thread". `persist_pipeline_cache` spawned a detached
thread for every pipeline creation that grew the blob, so a compile storm
created a thread per compile, each carrying its own copy of the whole cache
and racing the others through write→rename.

`persist` is that owner. One thread, started on the first save of the
process's life, with a mailbox holding one job. A new job replaces whatever
is waiting, which is a bound rather than a dropped save: a VkPipelineCache
only grows, so the newer blob is a superset of the one it displaces, and a
discard is by construction the newest decision about what the file should be.
A queue would let the backlog grow without limit while the disk is the slow
part.

Two things fall out. The tmp file no longer needs a per-save sequence number
— there is one writer, so the pid alone makes it private, and the second
process that could collide is another QEMU, which the pid already separates.
And the too-large discard, which used to unlink on the caller's thread under
the engine lock, is now a job like any other, so no filesystem call is left
on the draw path. `write_cache_atomic`'s newest-wins guard stays: it is the
function's requirement, not the caller's, and its unit tests still exercise
the concurrent shape.

Gates: `sixty_four_saves_create_no_thread_beyond_the_one_owner` (baseline
taken after the owner is up, /proc/self/task unchanged across 64 saves) and
`the_newest_submitted_blob_is_the_one_that_lands`, which is what makes
replacing a waiting job sound rather than a save the bound ate.

Verified: 2152 lib tests serial, clippy clean of new warnings, on
--no-default-features --features backend-vulkan.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:14:08 +03:00
Anees IqbalandClaude Opus 5 5c1be38242 compute: one watchdog thread for every dispatch, not one per dispatch
The plan's structural zeros say no host thread is created per EXEC, draw,
save or watchdog operation. Arming the compute stall proxy created one:
`spawn_compute_engine_stall_watchdog` spawned a thread that slept the whole
2s threshold and then, in the case that is not a stall, found the call had
returned and exited having done nothing. Each of those threads also held a
private copy of the kernel's whole SPIR-V module alive for the threshold,
which is the second zero — heap allocations per steady-state dispatch.

The measurement is unchanged: a backend call that no Vulkan fence timeout can
bound still gets a deadline, and a deadline that passes still writes
`compute_engine_stall` and the private request inputs under /tmp. What moved
is where the deadline lives. `stall_watchdog` holds a table of sixteen slots
allocated once and one thread that waits on the nearest armed deadline;
arming refills a slot's two buffers in place, so a slot allocates on its
first dispatch and never again.

Arming now returns a guard rather than an `Arc<AtomicBool>` the caller was
trusted to set. The slot returns to service when the call returns *or*
unwinds, and there is no way to arm without holding one.

The table is bounded on purpose, and a dispatch that finds every slot armed
says so under `compute_stall_watchdog_no_free_slot`. Growing the table
instead would trade the thread-per-dispatch for an allocation-per-dispatch,
and an unwatched dispatch that said nothing would read as "no stall" when it
means "no watchdog".

Gates, in `tests/vk_engine_compute.rs` because the allocation counter is a
`#[global_allocator]` the library's unit-test binary does not install — a
`measure` there reports zero for every path including one that allocates:
`a_watched_dispatch_that_returns_creates_no_thread_of_its_own` (64 arms after
the one thread is up, /proc/self/task unchanged) and
`a_repeat_arm_through_a_warm_slot_does_not_enter_the_allocator`.
`incomplete_compute_engine_call_fires_stall_proxy` stays where it was and now
also pins that the report names the threshold it was armed with.

Verified: 2150 lib tests serial, 18 vk_engine_compute, clippy clean of new
warnings, all on --no-default-features --features backend-vulkan.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:11:11 +03:00
Anees IqbalandClaude Opus 5 593250e282 draw: the five duplicate-binding declines get their first tests
`f6b61522` rewrote how `validate_v1` finds a descriptor bound twice — a
`BTreeSet` shared by three lists became a scan over the lists the draw already
owns — and then a grep found that none of the five declines involved had a
single test anywhere in the tree. A rewrite of untested logic is a rewrite
nothing checks.

Three tests, and each asserts something the rewrite could plausibly have broken:

`one_descriptor_binding_claimed_twice_is_refused_across_the_three_lists` — the
set was shared, so a sampler colliding with a storage buffer was a duplicate and
still must be. Also that the key is the pair and not the binding: two elements
of one descriptor array are the array, at a `descriptor_count` that clears the
range check a few lines earlier, so the case being tested is the one named.

`a_malformed_duplicate_reports_the_malformed_reason` — the invariant the prefix
cursor exists for. A sampler with a NaN LOD that also duplicates a storage
binding reports the LOD, because that check runs first; a hoisted pre-pass would
report the duplicate and lose the more specific reason.

`two_vertex_attributes_may_not_share_a_location_or_a_binding` — the two sets
that went the same way, including which of the two is reported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:03:02 +03:00
Anees IqbalandClaude Opus 5 f6b61522fb draw: validation's duplicate-binding set stops allocating
Six of the seven allocator trips a descriptor-bearing warm draw makes are
per-draw scratch. The seventh, and the largest at 104 bytes, was
`validate_v1`'s `BTreeSet<(u32, u32)>` — a set whose *first insert* is a heap
node, so every draw that binds anything, which is every real draw, paid one
allocation to look for duplicates among a handful of entries.

It is a scan over the lists the draw already owns. Quadratic in the number of
descriptors a shader declares, which is small enough that walking a slice
already in cache beats allocating and balancing a tree — and the two
`BTreeSet`s over vertex attributes go the same way for the same reason.

The prefix is a parameter rather than a pre-pass, and that is the part worth
reading twice: the duplicate checks are interleaved with per-descriptor
validation, so a sampled image with a bad `descriptor_count` and a sampler with
a bad LOD each refuse *before* their duplicate check. Hoisting the scan would
change which decline a draw that is both malformed and duplicated reports.

The ceiling moves 7 → 6. The trace list in the test moves with it, and now names
the obstacle the remaining four scratch sites hit: two of them hold `ash`
structures with borrow lifetimes — `vk::WriteDescriptorSet<'a>` names the buffer
infos beside it — so a device-owned buffer outliving the draw cannot hold them
without erasing a lifetime that is load-bearing. Those want an inline array
bounded by the device's descriptor limits, not a scratch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 19:00:09 +03:00
Anees IqbalandClaude Opus 5 bd43fccc56 draw: the descriptor-bearing warm draw, measured and pinned at seven
The structural-zero gate landed in `3e4276c5` is true of a draw that binds
nothing: `Vec::with_capacity(0)` allocates nothing and so does cloning an empty
`Vec`. A real guest binds things, and that shape was unmeasured — which makes a
narrow zero read as a broad one.

One storage buffer is enough to leave it, and the answer is **7 trips**. Traced
once and written into the test, so the next person to lower it starts from the
list instead of from the number:

    104 B  validate_v1
     16 B  the Vec<BindingSig> binding list
     16 B  LayoutKey::clone into the pipeline key
     48 B  BufferGatherRoles::of
    128 B  the bound-buffer list growing
     24 B  the Vec<DescriptorBufferInfo> collect
    256 B  the Vec<WriteDescriptorSet> growing

Every one is per-draw scratch a device-owned reusable buffer would hold instead,
except the two layout ones, which need the layout cache reachable without an
owned `Vec<BindingSig>` per draw.

A ceiling rather than an assertion of zero, because closing it is real work and
a gate that fails on arrival gets weakened or ignored. Lowering the constant is
the work; raising it needs a reason in the commit. The region brackets a counter
snapshot for the same reason the other one does — an early return allocates
nothing too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:56:55 +03:00
Anees IqbalandClaude Opus 5 7f4e618d54 draw: the boot the clear-values array owed, and what the zero does not cover
macos-15/x86/Vulkan, three rounds of the committed workload then a clean
SIGTERM: zero `FAIL` across 25 213 lines, 146 cadence windows all `busy=0` with
119 at `direct_frac=1.00`, `walk_records_render` 285 753 over 146 windows,
123 510 draws, first guest frame presented via rail resident.

119 of the 121 windows past the firmware phase, the same shape as the 86-of-88
and 139-of-141 the two rows above read. A change on the render-pass begin path
owes a live boot even when it is mechanically equivalent, and this is it.
`slate_source_stale` absent this time.

The row also records what the new structural-zero gate does *not* cover, because
a gate whose scope is only in the test body reads as broader than it is: the
measured draw binds no descriptors, and `Vec::with_capacity(0)` allocates
nothing. A draw that binds anything still builds a `Vec<BindingSig>` and clones
it into the pipeline key. That is the next piece of the same gate, and it is
named here so the zero is not read as covering it.

No code change. Register row only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:54:45 +03:00
Anees IqbalandClaude Opus 5 8aa30037c0 draw: the allocation zero says a draw happened inside the region
A zero trip count is only a reading if the measured region ran a draw. An early
return — a request rejected at validation, a batch already closed, a rail that
skipped — allocates nothing too, and would pass the structural-zero gate for the
wrong reason. That is the failure this file already names for its row parser and
it applies here.

The region now brackets a counter snapshot: exactly one `batch_joins` and zero
`batch_flushes`, so the measured work is one joining draw and not the flush that
ends a batch, which is not a steady-state draw either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:48:51 +03:00
Anees IqbalandClaude Opus 5 3e4276c51a draw: the live warm draw meets the structural zero, and the gate that says so
"Heap allocations per steady-state draw" is a required value in the replacement
architecture's structural-zero table. `reims-vgpu-core` has met it for the
semantic model since `a_warm_path_stops_allocating`. Nothing measured the live
executor, and the allocation instrument's own doc says why that matters: a
helper returning a `Vec` on a per-draw path costs one `malloc` a draw and shows
up as a percent or two of drain duty spread evenly across a profile, so no
single line got slower and nobody bisects to it.

Measured, the live warm repeat draw took **1 trip, 16 bytes**, every run. All of
it was `exec::clear_values` returning a `Vec` whose first `push` allocated, on
the overwhelmingly common draw of one colour target with no secondaries and no
depth.

It is a `ClearValues` array now, and the answer is zero.

The capacity is not a guess: `1 + MAX_SECONDARY_ATTACH` is
`PASS_MAX_COLOR_ATTACHMENTS`, the wire's own attachment bound, and the `+ 1` is
depth — so it holds every attachment a pass this device can build, and one more
would be a pass Vulkan could not be given either. Overflow refuses rather than
truncating, because Vulkan indexes this array positionally against the pass's
attachments and a short one silently gives a later attachment an earlier one's
colour. The cap is already enforced where the pass key is built; refusing here
under the same `SecondaryAttachmentCap` reason makes the bound the array's own
instead of a call order it cannot see.

`a_warm_repeat_draw_does_not_enter_the_allocator` is the gate, on the live path
through a real device: opener, eight warm-up repeats of one reused
`DrawRequest`, then one measured repeat, staying below `batch_max_draws` so the
measured draw is not the one that flushes. It asserts 0 rather than a ceiling,
because a structural zero's question is not how many are acceptable but which
per-draw path started allocating.
`a_clear_array_past_the_attachment_bound_refuses_rather_than_truncating` covers
the full pass and the one past it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:47:59 +03:00
Anees IqbalandClaude Opus 5 fc1f944d7f residency: the two readings the next move needs, taken while they were cheap
`pools` follows `caches` onto the device once the whole present is a transaction
against the device that owns the registry, run by a thread that holds one. That
thread is the drain. The question anyone will ask first is what it costs, and
the boot behind `10696be7` already answered it — so the answer goes at
`window_present_frame` rather than being guessed at later.

**The schedule would not change.** `presents == offered` in all 112 cadence
windows of that boot, with `busy`, `busy_fence`, `busy_acquire` and
`busy_no_area` zero in every one — the same shape the seven rail boots
`PRESENT_IN_FLIGHT` was measured on read. The window presents exactly once per
publish and refuses nothing, so its cadence already *is* the publish's cadence;
the move relocates where the code runs, not when.

**The cost would be small.** Window-thread engine lock: median 4 acquisitions
per second, median 155 µs held per second, median longest single hold 68 µs,
against a present rate of median 9.7 Hz and p90 28.8 Hz. A drain absorbing all
of it takes on about 1 ms per second.

Neither reading says the move is easy — the acquire must precede the blit
recording and it is the window's surface that owns the swapchain. They say it is
not gated on throughput, which is the question that would otherwise be answered
by guessing.

Doc only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:38:07 +03:00
Anees IqbalandClaude Opus 5 de7b2a89b9 agents: the rule states the form its gate can read
`AGENTS.md` states the replacement-coverage rule and `039c8a5b` gave it a gate
that can enforce it, but only for names written ``fn `name` ``. A rule stated
without that form invites the shape the gate cannot see, which is the shape
seven of the nine existing rows were already in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:35:57 +03:00
Anees IqbalandClaude Opus 5 039c8a5b07 dead: the coverage gate reads nine claims instead of two
`every_function_the_register_names_still_exists` is the gate the whole
disconnect amendment leans on: a group's legacy tests stop running the moment
they move, the register row is the only record that something replaced them, and
nothing in the build relates the two. Its own doc, `dead/README.md`'s rules and
`AGENTS.md` all say it checks every function a coverage column names.

It checked two of nine. Two reasons, both structural. It read only the register
proper, and seven of the nine coverage claims in the file are in the three-column
live-validation table below it. And it recognised a name only as a backticked
path with a `::` in it, while a coverage test is named the way a reader says it —
bare, `a_declined_publish_vouches_for_nothing` — which is indistinguishable from
the census routes, counters and slugs the rows are full of.

So a rename of any of those seven passed silently, in the record that exists to
stop exactly that. A gate reporting on what it did not inspect is worse than no
gate, because the rule it stands in for is then being trusted.

A coverage name is now written ``fn `name` ``. The `fn` is what separates a
promise about a function from the prose around it, so a row can go on naming
`pools/`, `winpub_*` or — as the newest row does — a slug that no longer exists,
in the same sentence, without either being read as a promise. Fourteen existing
names across nine rows are annotated; the parser reads both tables, keeps the
old `a::b::c` form, and asserts a floor on how many declarations it found, so a
parser that stops reading the form fails instead of passing empty.

Checked by rename: `a_declined_publish_vouches_for_nothing` renamed in the
register now fails the gate, and passed it before this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:35:41 +03:00