ce25f8a1bc040a28de36aaada0eda5107991ea76
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4a725bffc |
📝 The probe this harness was told not to rank changes with is the one that separates them disjointly
Component: `scripts/gpu-load-probe/gpu-load-probe.sh` — header doc only. No behaviour change; `bash -n` clean. That probe's header opened by explaining that the sustained-animation probe had saturated: ~26 800 draws and ~76 presented frames a second whatever the device did, drain duty 0.83, and a 3.9 us/chain saving worth under 0.1 % of `draws_s`. The conclusion drawn from it — "a probe the device cannot fall behind cannot rank a device change, in either direction" — is the first thing a session reads when choosing how to measure, and it is now wrong. Both premises have moved. The presenter no longer clamps at ~41 frames a second, and the device is faster: drain duty is 0.55-0.58 and a fast-latching macos-13 boot presents 109-119 Hz. On that tree the twenty-four interleaved boots of `f1765e27`, scored over their fast boots only, separate **disjointly** on this very probe — 113.2 Hz mean against 105.5 for a device doing 20.6 % more GPU work per draw, the slowest shipping boot above the fastest slowed one — while `us/draw` overlaps across the same fourteen boots. Corrected in place rather than appended to, with the original reading kept and marked as taken on a slower device, because the *shape* of that argument is still how a saturated probe should be recognised if one ever saturates again. The second claim further down — "it remains the arm for ranking a change" for the reason "that probe reaches duty 0.83 and this one does not" — is repaired to rest on the disjointness instead, since the duty figure it cited is no longer the one that boot produces. This probe keeps its own job, which the same paragraph already stated: loading one particular rail harder than a compositing page does, which is why it is worth having even when it is not the ranking arm. Verified: `bash -n` clean. No boot — this commit changes no code and asserts no new measurement; the numbers quoted are `f1765e27`'s captures re-read in `e196a3b0`. Not verified: macos-13 / x86 / Vulkan / one discrete host. Whether the sustained probe saturates again on a future faster device is exactly the thing this doc now tells the reader to re-check rather than assume. Co-Authored-By: Claude <noreply@anthropic.com> |
||
|
|
e33c755ed4 |
⚡ The idle drain handed back the image-slab block the next frame re-allocated, on every workload that leaves a gap between frames
x86 macOS / Linux Vulkan, `backend/vulkan/engine/pools`. The idle drain fires every `IDLE_DRAIN_INTERVAL_MS` (100 ms) whenever the poll heartbeat ticks — which is *most passes* on any workload that does not saturate the drain worker, because the heartbeat ticks whether or not the guest is publishing. Every fired pass trimmed the image slab's empty blocks to zero, overriding the hot release path's own `SLAB_KEEP_EMPTY` (2) churn budget between two frames of a live animation. The HOST_VISIBLE buffer pools were already protected from exactly this by `SETTLED_PASSES_FOR_BUFFER_TRIM`, and their own comment states the reason: "a live workload crosses a block boundary and back several times a minute and re-crossing costs a whole block allocation". The DEVICE_LOCAL image slab was trimmed from the caller, outside that gate, and so was not. Measured on a driven macos-13 boot of the load probe's WebGL dial: **257 block allocations against 162 idle trims of a 64 MiB block in a 25 s window**, alternating one for one about eight times a second, where the compositing load that saturates the drain worker read 39 in the same window. `vk_alloc_sites` prices a `slab_block` allocation at ~1.2 ms on this host (352-288 allocs and 367-289 ms across two censuses 5.7 s apart), plus the `vkFreeMemory` that is not timed. The sustained-animation probe churns too — 186 allocations and 155 trims over one boot's log, and 284 on the boot of the same binary that latched 59 Hz. The trim now runs from inside `trim_recycle_pools`, under the same settled state as the buffer pools, through `idle_slab_trim_keep` — one policy, one call site, so the two cannot drift apart again. `REIMS_VGPU_SLAB_RETAIN=off` restores the old behaviour for the A/B; it narrows in the sense `env`'s module doc requires, retaining strictly less memory and reaching no allocation the retaining arm would not also reach. Tests: 1871 + 82 pass, 0 failed (3 + 2 + 1 ignored: the wire fixtures, which are gitignored on this checkout). New test `idle_slab_trim_tests::an_unsettled_idle_pass_does_not_trim_the_image_slab` fails without the gate — it would read `Some(0)` for both arms. Clippy clean at `-D warnings` on all three arms including the cross-compiled Metal one. Not verified: the frame-rate effect of the change. The A/B needs two driven boots and the probe it was found with had to be fixed first (below). The `off` arm of the switch is not reachable from the test suite, which shares one `OnceLock` across every test in the binary. Also: the load probe now jiggles the pointer between two corner pixels every 20 s. The guest's display sleeps, and a probe that only animates does not stop it — a 145 s window read `display_vbl delivered=1607` frozen across two censuses, every QEMU thread under 20 % of one core, and the page's leg boundaries arriving exactly on schedule. A sleeping display reads as a device that stopped. |
||
|
|
a37c4f6cdc |
✨ A per-thread CPU census of QEMU, because every counter this device emits measures this device
A driven boot of the WebGL dial produces six frames a second with the drain worker's duty at 0.12. The fail log can say the device was idle seven eighths of the time and cannot say who held the other seven eighths — a computing guest, a vCPU spinning on a device register, and everyone asleep waiting on a round trip all read identically there, and only one of the three is this device's bug. QEMU names its threads, so a `/proc/<pid>/task` census separates them: a hot `CPU n/KVM` is the guest computing, a hot `qemu-main` with a cold drain is a guest blocked in a register write the shim handles inline, and four cold threads against a full wall clock is a latency problem rather than a throughput one. Costs two `/proc` reads a second. Written as its own script rather than inside a probe because it works for any workload; `gpu-load-probe` runs it for the length of its window. Verified: parses and reports on a live process on the host (the field-14/15 read counts back from the end of the line, so a thread whose name contains a space does not shift it). Not yet run against a boot. |
||
|
|
49af089720 |
✨ The load probe can raise draws, fragments and compositor blur, and walk a list of dial sets in one boot
The three dials this page had all raise *bytes*: composited surfaces, a vertex upload, a texture upload. What a paravirtualized GPU costs is per draw — decode, bind resolution, descriptor build, recording — so none of them could ask the question a real 3D application asks, and the one that came closest (`verts`) collapses the guest into its own JavaScript engine before it reaches this device. Three more dials, each landing somewhere the existing three do not: - `gldraws=N` splits the WebGL frame into N `drawArrays` calls with a uniform write between them, so the frame's *command stream* grows while its bytes do not. This is the axis a paravirt device is actually priced on. - `fragcost=K` puts K loop iterations in the fragment shader. It costs the guest nothing at all, so it moves ring backpressure and nothing else — which is how a reading says whether it was bounded by this device's CPU or by the GPU behind it. - `blur=R` puts an R-pixel `backdrop-filter` on every box over a static patterned backdrop. The window server pays it, on the GPU, with no JavaScript per frame. And `?scan=a=1,b=2;c=3&legsecs=S` walks a list of dial sets, one document each, S seconds apart. A boot costs minutes and a leg costs seconds, so a question about which dial moves which rail is answered by one boot instead of one boot per dial set. It navigates rather than opening tabs or iframes, so exactly one document is ever live; each boundary is announced by fetching a path the host's server has no file for, and the probe cuts the fail log by byte offset when that 404 lands — which needs no mapping between the host's clock and the device's. Verified: the page's script dry-runs under a DOM shim on the host for both a flat dial set and both documents of a scan (the list-carrying one hands over to leg 0, a leg document arms its own boundary timer). Not yet run against a guest; that is the next boot. |
||
|
|
23a6e3080f |
📝 The load probe's WebGL dial collapses the guest rather than the device, and the layers dial is the one that drives the gather rail hardest
Pathway: x86 macOS / Linux Vulkan. Probe only; no device code.
Four driven macos-13 boots of one binary put numbers on the three dials, and
one of them does not do what the probe was written to make it do.
dials duty draws/s gather regions/s
(sustained-animation probe, for scale) 0.83 26 800 427 000
layers=24&boxes=6 0.68 11 525 270 807
layers=16&boxes=6&verts=30000&tex=512 0.14 1 390 34 976
layers=8&boxes=6&verts=60000 0.11 1 017 26 592
**Any WebGL at all collapses the guest to ~1 000 draws a second at duty 0.11.**
The device is then idle seven eighths of the time and the boot measures
Safari's WebGL path rather than this device — the exact failure the probe
exists to avoid, one layer further out. The dial is kept and documented as not
usable for ranking, because the collapse is worth being able to reproduce in
one command; it is not quietly left looking like a working axis.
Two fixes went in first, so the reading above is not measuring the page:
- the vertex array is built once and only re-uploaded. The first version
rewrote all `verts * 2` floats per frame, which at verts=90000 gave 1 329
draws/s at duty 0.12 — indistinguishable from the collapse above, and
caused by the page rather than the guest. `bufferData` re-uploads the whole
array regardless, so eight mutated entries per frame keep the device
traffic and stop a browser eliding the call.
- the 2D canvas draws two fills rather than twenty-five, for the same reason:
the upload is `tex * tex` either way and the rest was guest paint time
bought at the device's expense.
`layers` is the axis that works, and its value is the *shape* rather than the
size: at 24 layers it drives 23.5 gather regions per draw against the sustained
probe's 15.8, so it is the heavier arm for anything about the guest buffer
gather despite the lower absolute draw rate. Nothing here beats the
sustained-animation probe for total device load, and the doc now says so.
Verification performed:
- the four driven macos-13 boots above, quiesced host, `bash -n` on the script
- each boot's dials are recorded in its own `load-url.txt`
Not verified: `tex` has not been measured on its own, and no rail but macos-13
has run this probe.
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|
|
f7bd9eadd8 |
✨ A probe with a dial on each of the three big rails, because the sustained-animation one has saturated and can no longer rank a device change
Pathway: x86 macOS / Linux Vulkan. New probe under `scripts/`; no device code.
`sustained-animation-probe` has stopped being able to measure this device on
macos-13. The guest produces ~26 800 draws and ~76 presented frames a second
whatever the device does underneath, and the drain worker sits at duty 0.83 —
it has idle time. A measured 3.9 us/chain saving in the pipeline span moved
`draws_s` by less than 0.1 %, and `slot_us` rose 77 -> 129 ms/s with
`ring_retire_blocks` 291 -> 496: the worker spent exactly what it saved
waiting, because there was no more guest work to do with it.
A probe the device cannot fall behind reports "no effect" for a real win and
for a real regression alike. That is the failure this replaces, and it is not
fixed by running the old probe longer or more often.
`gpu-load-probe` makes each guest frame heavier rather than asking for more
frames — which is also the only thing a page can do, since the frame rate is
the guest's own display cadence. Three dials, because they land on three
different rails and a change can help one and hurt another:
layers=N composited surfaces -> the writeback / store rail
verts=K per-frame WebGL bufferData -> the guest buffer gather rail
tex=W per-frame 2D canvas repaint -> the sampled-image rail
The gather axis is the one nothing else here reaches. On a compositing load
`buffer_guest_gather_bytes` is 5.8 GB/s over 427 000 transfer regions a
second — the largest GPU cost left in the device now the writeback scatters in
one dispatch — and a CSS page barely exercises it. A WebGL canvas that
re-uploads its whole vertex buffer every frame does exactly that, and the
shader is deliberately trivial so the cost lands on the gather rather than on
fragments.
Determinism follows `anim.html`'s rule and for its reason: every step is per
frame, nothing in the content reads the clock, so two boots draw identical
content per frame and differ only in how many frames they get through. Layer
promotion is forced with `backface-visibility` plus a 3D transform rather than
hinted with `will-change`, which that page measured to be advisory often enough
to split boots of one binary into two clusters 24 % apart.
The URL is written to `<outdir>/load-url.txt`, so a result read later says
which load produced it. Two boots at different dials are two workloads, not two
readings.
Verification performed:
- `bash -n` on the script; the shim `kb/harness/gpuload.sh` (gitignored)
drops it into `ab.sh` as `AB_PROBE` the way `anim.sh` does
Not verified: **this probe has not been run against a guest yet.** It is
written to the same interface and the same serving pattern as
`sustained-animation-probe`, whose shape it copies deliberately, but no boot
has confirmed Safari renders the page, that WebGL is available on the macos-13
rail, or what the dials are worth in counters. That is the next thing to do
with it, and until then no number may be quoted from it.
Co-Authored-By: Claude <noreply@anthropic.com>
|