Commit Graph
10725 Commits
Author SHA1 Message Date
Anees Iqbal 08848fd8a5 Runtime: a content's later cell lookup is later_cell, apart from its field
`Cells` had a field and a method both named `later`, so an intra-doc
link to `Cells::later` named either. The method that finds or enters a
key's cell is now `later_cell`; `Cells::later` names the map alone.
No behaviour change; verified by the merge check's build, clippy and
private-doc steps at this commit.
2026-12-05 00:28:25 -08:00
Anees Iqbal 6789748f41 Runtime: a content's later pipelines are cells, made outside the map's lock
A render content's `VkPipeline`s made by the first draw that takes them
(the line and point class's where the descriptor names neither, and those
under other raster states) sat in one map, `Cells::later`, whose lock
`found` held across the driver's create. A draw of one content that needed
any other of those pipelines (another class, another raster state) waited
behind that create, and its wait was counted nowhere; a draw that needed
the same one waited on the lock and counted nothing either.

The map now holds a cell per key, the `Main` cell the content's main
pipelines already use: `Cells::later` finds or enters a key's cell under
the lock and returns it, and the make runs on the cell with the map's lock
released. A draw that meets another thread's make of the same key waits
on that cell's condition and is a first-use wait at the key's own site
(lines, points, raster); `Main::pipeline` now takes the site, the main
cells passing `Unfinished` as before. A make that fails keeps nothing and
wakes its waiters, which make it themselves, as a main cell's do, so no
waiter is left on a failed cell. The words twin's later pipelines, made
beside the plain one, use the same cells through `make_ahead`. The map
stays bounded at 15 keys; a cell of a failed make stays empty under its
key.

Docs: the line, point and raster first-use wait metrics count a draw that
waited for another thread's make in flight; the runtime README says a draw
needing another of the content's pipelines waits for no make but its own.

Tests: `later_cells`' two device tests (red at the commit before) and a
device-free `main_cells` test of a waiter whose make in flight fails.
2026-12-05 00:28:25 -08:00
Anees Iqbal b4a35c31ae Tests: a draw of one later class during another thread's make of a second
A render content's `VkPipeline`s made by the first draw that takes them
(the line and point class's where the descriptor names neither, those
under other raster states) sit in one map whose lock `found` holds across
the driver's create. Two device tests show what that costs:

- a draw of points on one thread while another thread's draw of lines is
  making the line class's pipeline must make its own and return, the make
  of lines holding until it has (for at most 10 s, so a draw held behind it
  fails the test rather than hangs it);
- a draw of lines that meets another thread's make of the line class in
  flight must wait for that make and take its pipeline, counted as a
  first-use wait of the line class, as the make's own draw is.

A test-only entry, `RenderCompiled::pipeline_during`, runs the draw's own
lookup with a hook inside its make, and the thread-local `WAITING` tells a
test when a call begins to wait for a make of a `Main` cell in flight.

Both fail at this commit: the draw of points waits behind the lock until
the make of lines gives up, and the second draw of lines blocks on the same
lock, so it never waits on a cell and counts nothing.
2026-12-05 00:28:25 -08:00
Anees Iqbal f2461b26de Runtime docs: a guest session's line-class pipelines on a 780M, in place of the older heaviest figure
The known gap on a second topology class under RADV (no
dynamicPrimitiveTopologyUnrestricted) gave 225 ms as the heaviest second
compile measured on a 780M. A guest's session start compiles one far heavier:
the consumer's two diagnostic boots on the Radeon 780M with cold caches
(88012 at ea428bca8b plus the diagnostic prints, 88093 at cc13a21eb9 plus the
same prints) each made 4 second pipelines, all of the line class (topology 1,
the default raster state), 1,170.8 and 1,204.4 ms in all, the heaviest
1,165.8 and 1,197.6 ms and the other three under 10 ms each; the 4 lines
first-use waits matched them (1,171.3 and 1,204.8 ms). Counts from the
consumer's grep over each whole boot, classes and counts only. The gap now
states that figure, with no job or app named.
2026-12-05 00:17:53 -08:00
Anees Iqbal 9860c14142 Runtime docs: a 4:2:2 linear sample's GPU time on the RTX 3090 with the decode as it is now
The 4:2:2 bullet lost its GPU-time figure when the decode shrank, since the
figure measured the decode before it. The committed timing test
time_a_linear_sample_of_a_1080p_frame (c08da02d8c) measured it again: a
linear sample through a runtime sampler (both decode arms, sixteen fetches)
at each texel of a 1920 by 1080 frame took 90.5 to 90.7 µs on an RTX 3090,
against 81.1 to 81.6 µs for the same kernel over RGBA8Unorm: 1.11 to 1.12
times, 3 rounds, each the median of 9 (job m3-max-88105, NVIDIA 620.70.06,
P0 throughout). The README states it as about 91 µs against 81 µs, 1.12
times.
2026-12-04 23:54:59 -08:00
Anees Iqbal c08da02d8c Tests: time a linear sample of a 1080p 4:2:2 frame beside RGBA8Unorm's
The runtime README's 4:2:2 paragraph lost its GPU-time figure when the decode shrank (clamp-to-edge
taps, each footprint row's pairs fetched once): the figure measured the earlier sixteen-fetch decode
with a probe that was never committed. This is that probe as a committed test, so the figure has a
source.

tests::chroma_time's time_a_linear_sample_of_a_1080p_frame, #[ignore]d and run with --run-ignored
only (it prints GPU times and asserts nothing of time, as mesh_costs_print_per_card does):
- xr_samples' xr_sample_runtime (a linear clamp-to-edge sampler state at slot 0) and
  xr_sample_constexpr (its constexpr linear clamp-to-edge sampler) sample each texel's centre of a
  1920 by 1080 frame, one thread a texel, over a GBGR422 texture over a Private buffer at 3,840 bytes
  a row and an RGBA8Unorm one at 7,680, positions and outputs in Private buffers;
- each dispatch is a command buffer of its own, timed by its GPU start and end; a round takes the
  median of nine of each kernel over each texture, the four taking turns; unmeasured rounds run for
  a second first (an NVIDIA card raises its clocks under load), then three rounds print each
  kernel's two medians, their ratio and each texture's form (in place or the copy's cause);
- it asserts the decode ran (chroma_contents +2, chroma_launches = every GBGR422 dispatch, none for
  RGBA8Unorm) and that every value written is finite and within [0, 1] (the outputs start as NaNs).

chroma_pairs' buffer_of, byte and GROUP are now pub(crate) for it.

Verification follows this commit: a run on lavapipe and one on the RTX 3090.
2026-12-04 23:49:30 -08:00
Anees Iqbal b0c9c9f0c9 Runtime docs: a 4:2:2 preview's first open with the decode as it is now
The known gap on the first bind of a 4:2:2 texture held placeholders for the
consumer's proof boot, and figures from the decode before the per-site
shrink. It now states the current figures only:
- the 40-site inline content (251 to 256 ms cold, 0.4 ms warm on the
  Radeon 780M, beside the state's own 78 to 83 ms) and one site (4.0 ms);
- a camera preview's first open with the driver's shader cache empty: frames
  held about a second (989 ms at the 99th percentile), the content's
  translation 111 ms and its pipeline 870 ms; a second open in the same
  session waits for nothing.
The rolled-shape sentence and the older figures go: the rolled shape (217 to
223 ms) is below the inline figure, and its slowdown against the older
decode is recorded in the bug list. The handle line no longer names a job.

Evidence: the consumer's boot m3-max-88093 at cc13a21eb9 plus the diagnostic
prints (build m3-max-88086), on the same Radeon 780M as boot 88012, with
fresh rt and Mesa caches: unfinished-pipeline waits 2 in 878.6 ms (1448.8 in
88012), the preview state's create 870.0 ms (1437.9), take-to-show p99
988.7 ms (1595.5), fragment 58,866 instructions and 737 fetches (80,978 and
821), translate 110.7 ms (149.0), 0 refusals, the picture right; the second
open made nothing and waited for nothing (p99 2.2 ms).
2026-12-04 23:46:13 -08:00
Anees Iqbal 2ffb83a4f1 Pin AE bless: the golden hashes after firstopen
The bless at cc13a21eb9 (job m3-max-88077, BLESS_JOBS=4) moved only the
semantics line, 2396 to 2397, after firstopen's SEMANTICS_VERSION bump: no
cell changed, since no golden fixture lowers a 4:2:2 decode.
2026-12-04 23:37:14 -08:00
Anees Iqbal cc13a21eb9 Translator: a 4:2:2 row's fetches are named, not indexed
Clippy's indexing_slicing (denied in the tree) refused lower::texture::chroma::row's slices of
its fetched bytes and its store into the texels' array (merge check job m3-max-88057). The six
fetches are now three pairs of named texels, and the two texels are made by one closure. The
instructions are emitted in the same order as before, so the module is unchanged.
2026-12-04 23:08:59 -08:00
Anees Iqbal 88d60a299c Runtime docs: the first 4:2:2 bind's content make, with the 780M's figures, and the decode's fetches
The runtime README's 4:2:2 paragraph now states the decode as the translator writes it:
- a row's two taps share six fetches, so a linear sample or a gather reads twelve texels;
- a constexpr sampler's sample holds its filter's decode alone, and any other sampler's holds both
  decodes behind the filter branch, sixteen fetches;
- every tap clamps to the edge, citing MTLPixelFormat.h for both formats.
The paragraph's 135 µs RTX 3090 figure measured the earlier sixteen-fetch decode and is removed
until it is measured again.

A new known gap states that the first draw or dispatch binding a 4:2:2 texture at a state's slot
makes that state's content and waits for it, where Metal makes none, with the Radeon 780M's
figures (RADV, Mesa 26.2.6):
- 40 decoded sites in line: 251 to 256 ms cold, 0.4 ms warm (job m3-max-88049; a probe build that
  writes no loop, the shape of the guest's 41 sites);
- the same sites where the translator writes them as a loop: 217 to 223 ms against 156 to 159 ms
  before the rows shared their fetches (job m3-max-88041);
- one site: 4.0 ms cold;
- the camera preview's first open before the change (1,508 ms cold, about 145 ms warm), and
  placeholders for the consumer's boot after it.
Handle re-makes: 0 seen in the consumer's session (boot 88012).
2026-12-04 23:06:43 -08:00
Anees Iqbal 269ba10df0 Translator: a 4:2:2 decode clamps its taps to the edge, fetches each row once, and holds a constexpr sampler's filter alone
A camera preview's state re-made for a 4:2:2 texture at its fragment slot (41 decoded sample sites)
took 1438 ms to create on the Radeon 780M against 437 ms for its own content (boot 88012): each
site decoded 20 fetches behind the branch on its sampler's word, with every address mode's
arithmetic at each tap, about 1,111 instructions a site.

- Addressing: the decode clamps every tap to the edge, whatever the sampler states. Metal's
  MTLPixelFormat.h says of both GBGR422 and BGRG422 "When sampling, ClampToEdge is the only usable
  wrap mode". The other modes' arithmetic (the word's per-tap remainders, mirrors and border
  texel, its position by mode and offset rule) is gone from the decode; a bicubic sample's taps
  clamp too.
- Rows: a linear footprint's or a gather's two taps of a row share six fetches (the first tap's
  pair and the pairs on either side of it; lower::texture::chroma::row), each texel's codes
  converted once, each texel's arithmetic and values as before: 12 fetches for the 2x2 where 16
  were.
- Static filter: a constexpr sampler's magnification filter is known in the translator, so its
  sample holds that filter's body alone, with no branch; a runtime, argument buffer's or constexpr
  array's sampler keeps both bodies behind the branch on its word. The coordinates' pixel flag is
  likewise read here for a constexpr sampler.
- One position per axis, shared by both bodies.

Values are unchanged for ClampToEdge: the same codes, integer arithmetic, correctly rounded values
and FMix order. SEMANTICS_VERSION 2397.

Verified: tests::engine_chroma_pairs::a_four_two_two_decode_fetches_each_footprint_row_once, red at
the previous commit; the device and conformance values and the 780M's make time follow in this
lane's report.
2026-12-04 23:06:43 -08:00
Anees Iqbal 8e73a338c1 Translator: a test that a 4:2:2 decode fetches each footprint row once (red)
What the decode adds at each site, over the module lowered without it, on every committed profile:
a sample through a runtime sampler 16 fetches (its linear body's 12, two rows of six shared fetches,
and its nearest body's 4) and one selection; a gather 12; a read 4; a sample through a constexpr
sampler its own filter's body alone (12 magnifying linearly, 4 nearest) with no selection; and no
integer remainder at any site, the taps clamping to the edge whatever the sampler states. Today a
sample decodes 20 fetches behind a branch even through a constexpr sampler, a gather 16, and each
tap carries every address mode's arithmetic. It replaces the size probe, printing every row's sizes
and grd_half_many_samples' 40 sites of fragment texture 3.
2026-12-04 23:06:43 -08:00
Anees Iqbal ebd7ab2a35 Tests: a 40-site 4:2:2 content beside the one-site one
grd_half_many_samples (40 runtime-sampler samples of fragment texture 3, the slot the camera boot's
state decodes) joins the module size probe (with samples, selections and loops) and the driver's
make time, for the shape of the camera boot's 41 decoded sample sites.
2026-12-04 23:06:42 -08:00
Anees Iqbal 401a1a150e Tests: the size of each 4:2:2 module and the driver's make of a 4:2:2 render content
A translator test prints each module a 4:2:2 decode lowers beside its plain module (instructions,
texel fetches, words), and a device test prints the driver's make of dl_runtime's plain content and
of its content lowered for a 4:2:2 texture at fragment texture 0. They measure the first-open stall of a
4:2:2 preview: the runtime README's figures for it come from them.
2026-12-04 23:06:42 -08:00
Anees Iqbal 38392496f7 Pin AD bless: the golden hashes after specwide
The bless at 79698bdd67 (job m3-max-88022, BLESS_JOBS=4) moved only the
semantics line, 2395 to 2396, after specwide's SEMANTICS_VERSION bump: no
cell changed. encodetime (e2964480ba) changes no translation, so the table
holds at this tip.
2026-12-04 23:05:56 -08:00
Anees Iqbal e2964480ba Runtime docs: Metrics::translations_at_encode lists the 4:2:2 content among its makes
The count's doc named five kinds of make at encode and left out the content a compute or render
state makes for the 4:2:2 textures a dispatch or draw reaches, which Metrics::chroma_contents
counts and which the same make at encode also counts and times (render_pipeline_state and
PipelineInner::variant call Counters::translation_at_encode for it). It now names six. The
runtime README's known gap of makes at encode names that make and the depth range twin too,
and the new total translation_at_encode_nanos beside the count and the longest.
2026-12-04 22:51:26 -08:00
Anees Iqbal 487ed9584f Runtime: the unattached-colours device test prints its make at encode's time
The test asserts Metrics::translation_at_encode_nanos; printing the device's total after the one
make at encode gives each run's cost of that make (a translation and its pipelines' compiles on the
encoding thread) beside the pass/fail.
2026-12-04 22:51:25 -08:00
Anees Iqbal f2f9bee818 Runtime: a make at encode adds its time to Metrics::translation_at_encode_nanos (green)
Counters::translation_at_encode, which every make at encode calls with its nanoseconds of
host_time (the render content and its depth range twin, the compute content of a dispatch's
bindings, and a dispatch's partial-threadgroups variant on emulated SIMD groups), now sums them
beside the count and the maximum. Turns the unattached-colours device test of the previous commit
green.
2026-12-04 22:51:25 -08:00
Anees Iqbal 56f890f59a Runtime: Metrics::translation_at_encode_nanos, the total time of makes at encode, and its test (red)
Metrics kept a count of the translations made at encode and the longest one's time, but no total,
so a consumer could not say what those makes cost over a frame or a boot: a maximum does not
take the difference of two reads. This adds the field, read from its own atomic, with its doc
comment, and the signature table's row. The atomic is not charged yet, so the test fails here.

The test is the unattached-colours device test, which makes one render content at encode on
every device: the device's total is 0 after the matching draws (a fresh device, no make at
encode), rises at the first lacking pass's make and not at the second's reuse, and ends at least
the longest make's time. Expected red: the first lacking pass's total does not rise.
2026-12-04 22:51:25 -08:00
Anees Iqbal 79698bdd67 Lowering: a speculative load through a wide pointer is checked against its slot
canon marks a load speculative where it runs in lanes the program did not run it in: each load
of a branch arm it speculates (a constant reference's, at offset 0) and each constant-reference
load the hoist moves. Lowering checks such a load at any offset against its slot's buffer, but
only on the static-root path. Where a phi, select or pointer cell joins the reference's pointer
with one loaded from memory, the reference is a wide pointer, and every access through a wide
pointer went unchecked: a speculated arm's load read the reference's first bytes in every lane
of the branch's block, through a binding the program never read there, past its end where the
guest bound it shorter than the load.

The fix: the dynamic family selects a speculative load through a wide pointer, of a leaf or of a
pointer, as DynStrategy::SpeculativeLoad: the static-root access of the one slot the pointer's
root set names, at the pointer's fixed offset, marked speculative, so note_variable gives the
slot its SlotBounds, the zero range is placed, and emit::prepare checks the load and reads zero
outside, as for a static-root speculative load. The slot still joins the dynamic plan's slots
(plan_entry), so it keeps the device address every wide-reached slot has, on a bound-form device
too. A speculative load through a wide pointer of another root set or of an offset not fixed is an
invariant violation: canon marks no such load. Its census name is the static-root load's it
emits (access.load.psb.checked, or access.dynamic.load_pointer.psb for a pointer).

Which fix, and why this one: (a) lowering checks the load, against (b) speculate.rs leaving such
an arm unflattened. (a) is the smaller structural change: about 90 lines in the dynamic family,
all reusing the static-root check, and it moves only the loads the bug names. (b) cannot see
width: a wide pointer is lowering's decision (the memory plan's dynamic component), so canon
would have to over-approximate with const_hoist's shared-pointer walk, which also unflattens
arms whose loads go through narrow joined pointers and are checked today, giving their group
operations the AIR's lanes where Metal speculates them (rule 1), or carry the memory plan's
provenance into canon.

const_hoist's module docs no longer say lowering checks a wide pointer's access nowhere.
SEMANTICS_VERSION 2396.

Verified: engine_hoist_contain's two wide-pointer tests fail at f4a0f4e628 (lavapipe's address
form and every committed profile, jobs m3-max-87967 and m3-max-87970): no SlotBounds for k's slot,
and the interpreter's OutOfBounds trap in the short-binding case of both forms (word: 4 bytes read
from a 2-byte binding; pointer: the second word of an 8-byte load past a 4-byte one), while the
whole, unbound and flag-on cases pass. The green run with this commit is named in the lane's
report.
2026-12-04 22:42:05 -08:00
Anees Iqbal 0dcd3230e8 Red: a speculated arm's load through a wide pointer reads outside a short binding
engine_hoist_contain gains a third kernel, `wide`, in two forms: a short arm beside a
quad_broadcast_first, which canon's arm speculation runs in every lane of the branch's block,
loads `k`, a constant reference (a 4-byte word, or an 8-byte pointer whose address the arm
truncates), where a select joins k's pointer with one loaded from memory. That select makes k a
wide pointer, so the arm's speculative load goes through the wide-pointer family, which checks no
access: the load reads k's first bytes in every lane whatever k's binding.

Two tests:
- a_speculated_arms_load_through_a_wide_pointer_is_checked: on every committed profile under the
  identity domains, with and without the bound form's query, k's slot reads its SlotBounds and
  the module the zero range, and the arm's load is not a wide-pointer load (one
  access.dynamic.load, the select's own, and no access.dynamic.load_pointer.wide).
- a_speculated_arms_load_through_a_wide_pointer_reads_nothing_outside_a_short_binding: on the CPU
  interpreter (lavapipe's address form), with the arm's condition off and k bound half as long as
  its load where its mapping ends, the load must not trap; with k whole or unbound, and with the
  condition on, out holds the program's words.

Expected red at this commit: no SlotBounds for k's slot, and the interpreter's OutOfBounds trap
at k's address in the short case of both forms. The unbound case is a control: the nil buffer's
64 KiB holds the load.
2026-12-04 22:42:05 -08:00
Anees Iqbal 43b9dc279e Conformance: the 4:2:2 linear-sample rows list the cards' digest beside llvmpipe's
Pin AC's short round failed every card's replay on the two 4:2:2 linear-sample
rows (chroma-pair-texel-linear-samples-gbgr422 and -bgrg422). Their venue is *,
and their answer was the digest llvmpipe and KosmicKrisp on an Apple M3 Max give.
The RTX 5080 Laptop GPU, RX 7900 XTX, Iris Xe and RTX 3090 all give one other
digest per format (70c2266e... for GBGR422, 3f65b2f3... for BGRG422), so each
card read the row as both unlisted and no longer held.

The gap is the same on every venue: PrecisionNote::BicubicFilterArithmetic,
the decode's own filter arithmetic in f32. Its value differs by a property no
venue description states, so each row keeps venue * and lists both answers
with the ledger's separator, as known_gaps.rs allows. The gap text names the
run each answer came from. A third digest still fails as a new gap.

Verified: the four replays' proposed rows (jobs m3-max-87952, 87957, 87958,
87961) give the same two digests; the coverage document regenerates unchanged.
The replays of this commit follow.
2026-12-04 22:16:37 -08:00
Anees Iqbal 2ae06af340 Docs: pin AC's source comments state the Mac and OS a measurement ran on, not its job
The published crates' doc comments on EntryPoint::mismatched_component_counts (metal2vulkan-air
abi) and LoweringInputs::widened_varyings (metal2vulkan pipeline::lower_inputs) named lab jobs; so
did the module docs of the conformance cases chroma_pairs and one_level_filters and of the runtime
tests chroma_pairs and mismatched_varyings, all added in pin AC's range. Each now names the Apple
M3 Max and macOS 27.0.1 alone, as a8cec25600 did for docs/API.md. The paragraphs are rewrapped at
100 columns; the conformance ledger's reason column keeps its job ids. No code changes, and no file
here is a runtime-sources input (pin-compute.py gives the committed 870c1824... at this tree).
2026-12-04 21:59:03 -08:00
Anees Iqbal ea428bca8b Pin AC bless: the golden hashes after varyflag, levelrule, yuv422 and the watchdog
The golden table re-blessed at ae78d6c14f (pin AC's stack on pin AB' cb574b06fa), on the Apple M3
Max, job m3-max-87911 (inventory, golden, printouts, linkhalf and chains each exit 0):
- the semantics line moves 2394 -> 2395, yuv422's number;
- no cell moves and no row is added, the metal-as fixtures included: a 4:2:2 texture's decode
  lives only in a content re-lowered for its bindings, so no default module changes.
2026-12-04 21:55:45 -08:00
Anees Iqbal ae78d6c14f Validation: the worker watchdog charges compressed and swapped memory, not resident memory alone
The worker memory watchdog summed each process-group member's resident size: VmRSS on Linux,
proc_pid_rusage's ri_resident_size on macOS. Under memory pressure the system takes a worker's
pages out of its resident set (macOS's compressor; Linux's swap, to a disk or to compressed RAM
such as zram), so a group holding more than the 500-MiB ceiling could pass it unseen. On CI's
macOS job at 9e7034c214, worker_memory_watchdog_enforces_aggregate_limit ran into its 20-s
deadline: its two 256-MiB children (one written byte a page, nearly all zero) never summed to the
limit. That is the product ceiling going soft under pressure, not only a test problem.

What a member is charged (process_charged_bytes) is now:
- macOS: the larger of ri_resident_size and ri_phys_footprint, from the same proc_pid_rusage call.
  The SDK's sys/resource.h declares both in rusage_info_v2 with no comment; footprint(1) defines
  the ledger: "phys_footprint - the current value of the kernel ledger tracking the amount of
  dirty memory owned by a process", Dirty "includes "(Swapped)" memory, ... and memory written to
  implicitly, such as zero-filled", and (Swapped) is "A subset of Dirty memory that has been
  compressed or swapped to storage by the kernel". The footprint leaves out clean file-backed
  pages the resident size counts, so the larger of the two never trips later than before.
- Linux: VmRSS + VmSwap from the same /proc/<pid>/status read (status_charged_bytes). The member
  rules of process/linux.rs are unchanged: a member before its exec that shares its parent's
  memory is charged nothing, a copy-on-write one is counted (an overcount, never an undercount),
  and every other member is charged its own VmRSS and VmSwap, read after its flags.

Names that would lie are renamed: worker_resident_bytes -> worker_charged_bytes,
member_resident_bytes -> member_charged_bytes (both platforms). process_resident_bytes keeps
the resident size alone for own_resident_bytes, whose figure (corpus-triage's parent_rss_bytes,
the supervisor-heap test) stays resident memory; its doc no longer says it is read as workers'
are. The stop's message says "process-group memory budget". Docs that called the sampled figure
RSS (worker.rs, compile.rs, alloc.rs, audit.rs, budgets.rs, translation_audit.rs,
authored_compile.rs, corpus-pipeline.rs, corpus-triage's usage, docs/HOWTO.md's recipe) now say
memory; report keys (peak_*_rss_bytes, peak_resident_bytes) keep their names.

A stop at the ceiling is a recorded `failed oom` row of the engine census and of the
specialization lane's attempts, and its detail is the stop's message, so the measure can change
a recorded row: ENGINE_CENSUS_VERSION 8 -> 9 and SPECIALIZATION_AUDIT_VERSION 6 -> 7, as both
were bumped when the member charging last changed (engine 5, specialization 2). The authored
compile census records no worker stop (failures are never cached), so its version stays.

The fixture is unchanged: it now trips on its zero-filled pages wherever the system compresses or
swaps them.

Verified: a_members_swapped_memory_is_charged failed at the parent commit (lavapipe-free CPU
job m3-max-87876: left 307200000, right 563200000; 19 other worker::process tests passed). The
macOS arm is unchecked before the push (no Mac job); it stands on libc 0.2.189 and 0.2.191's
rusage_info_v2 (pub ri_phys_footprint: u64, beside the ri_resident_size this code already read)
and on CI's macOS job.
2026-12-04 21:24:00 -08:00
Anees Iqbal a0c8c1c88b Validation: a test that the worker watchdog charges a Linux member its swapped memory (red)
The worker memory watchdog sums each process-group member's VmRSS on Linux
(process_resident_bytes) and ri_resident_size on macOS. Under memory pressure
the kernel takes pages out of the resident set (swapped out on Linux, to a disk
or to compressed RAM such as zram; compressed on macOS), so a worker holding
more than the 500-MiB ceiling can pass it unseen: on CI's macOS job,
worker_memory_watchdog_enforces_aggregate_limit ran into its 20-s deadline
with two 256-MiB children that the limit never stopped.

This commit draws the status read's charge out as status_charged_bytes,
unchanged (VmRSS alone), and adds a_members_swapped_memory_is_charged: a
synthetic /proc/<pid>/status with VmRSS 300000 kB and VmSwap 250000 kB must be
charged 550000 kB. It fails here; the next commit charges VmSwap.
2026-12-04 21:24:00 -08:00
Anees Iqbal 4e24418619 Conformance: Metal's timings of the four 4:2:2 sampling cases
conformance times --runs 8 --write over chroma-pair-texel-gathers-gbgr422, -gathers-bgrg422,
-linear-samples-gbgr422 and -linear-samples-bgrg422 on the Apple M3 Max, macOS 27.0.1, job
m3-max-87887. The run adds times to the four recordings and changes no answer: 508 lines added,
none removed. times::every_case_carries_its_timing failed without them (conformance suite job
m3-max-87880, 1062 of 1064 passed with the textures guard); this commit closes it. Coverage
regenerated.
2026-12-04 21:23:52 -08:00
Anees Iqbal 10ef459cd0 Conformance: the textures table's guard leaves the 4:2:2 formats to chroma_pairs
With GBGR422 and BGRG422 held as their bytes in R8G8_UNORM, the translator's byte format of each
is a 2-byte texel, so the guard asked the textures round-trip table for them
(cases::textures::tests::the_table_is_exactly_the_formats_whose_texels_are_metals_bytes failed,
conformance suite job m3-max-87880). Their host round trips are chroma_pairs' copy cases', on and
off the 2-texel pairs, so the guard sets them aside as it sets aside the copies-only formats.
2026-12-04 21:23:52 -08:00
Anees Iqbal ffec1a43ab Runtime README: the 4:2:2 content's cost, measured once
The planner's one timing for the known gap (job m3-max-87867, an RTX 3090 at P0, 620.70.06): a
linear sample at a quarter point of each texel of a 1920 by 1080 frame through fpv_swz_sample,
three alternating rounds of 24 command buffers, the median GPU span of each round's last 20:
GBGR422 over a Private buffer in place 135,424 / 135,232 / 135,360 ns, RGBA8Unorm over a Private
buffer in place 80,544 / 80,576 / 80,512 ns, ratio 1.68. The content's make at the first dispatch,
the translation at encode, took 4,746,194 ns there (Metrics::translation_at_encode_max_nanos),
within the translator's bounded lowering as a state's make is, far inside the 20 s ceiling. The
timing test is a carried patch, not committed.
2026-12-04 21:23:52 -08:00
Anees Iqbal d73a21686c Ledger: the 4:2:2 linear-sample rows are every venue's
KosmicKrisp on an Apple M3 Max (job m3-max-87863, the pre-push replay at 4d09c9ed97) answers both
linear-sample sites with the digest llvmpipe gives (job m3-max-87851): the decode's filter is the
shader's arithmetic, so the rows' venue widens to *. Those two were the replay's only unexpected
lines. Coverage regenerated: no change.
2026-12-04 21:23:51 -08:00
Anees Iqbal 5fc261de14 Conformance: the 4:2:2 fills declare the texture's static note
texture-fills-240 and -241 make a GBGR422 and a BGRG422 texture, whose static note
(bicubic-filter-arithmetic, Texture::precision_note) the rt side announces; the replay at
bff946134f (job m3-max-87842, llvmpipe in the image) read it as undeclared at their notices site.
Every other row that run held was as the ledger lists. Coverage regenerated: no change.
2026-12-04 21:23:51 -08:00
Anees Iqbal 8f90cd52ec Versions: ARTIFACT_FORMAT_VERSION 618, the number the orchestrator assigned
The held push's varyflag takes 617; this branch's artifact codec carries
StageInterface::handle_float_images and the two 4:2:2 lowering inputs.
2026-12-04 21:23:51 -08:00
Anees Iqbal 4b4d8f5e77 Ledger: the 4:2:2 rows follow the lavapipe replay; coverage regenerated
From the replay in the lavapipe image (job m3-max-87827) and the commits since:
- heap-sizes-422's 20 rows go: each site now matches Metal under the accepted difference of the
  device's own heap sizes.
- chroma-pair-texel-reads, -samples and -gathers (both formats) go: reads were announced
  (device-texel-conversion, a native note), and the sampling cases now declare the notices the rt
  side announces.
- chroma-pair-texel-linear-samples-* are divergent rows on llvmpipe: the decode's own filter
  arithmetic, the texture's static note BicubicFilterArithmetic, as ruled.
- chroma-pair-copies-* name Gap::ChromaPairsUse of CloseRows at the 30-byte-row blit (step 37).
- texture-fills-240 and -241 now reach the rt side's fillTexture, Unavailable as every other
  fill row.

The replay at this commit checks the rows.
2026-12-04 21:23:51 -08:00
Anees Iqbal 97f1de6040 Versions: RUNTIME_VERSION 2580 with the runtime sources re-pinned; SEMANTICS_VERSION 2395
The changed behaviour of a run: GBGR422 and BGRG422 map to R8G8_UNORM with
FormatEmulation::ChromaPairs (metal/format/mod.rs, a pinned runtime input) instead of the
Decoded RGBA8 twin, so RUNTIME_VERSION moves with the hash (870c1824..., by pin-compute.py, which
gives development's committed pin at 9e7034c214). The guard failed at 27104ce862 (job
m3-max-87839). SEMANTICS_VERSION takes 2395, after 2392 (pin AB') and varyflag's 2393 and 2394.

Also: the ChromaPairsUse basis names CloseRows without a link, so REFUSALS.md carries no bracket.
2026-12-04 21:23:50 -08:00
Anees Iqbal 4edb790b23 Runtime: a 4:2:2 texture states its static note; a copy of its rows closer than the region's is a gap
The lavapipe conformance replay (job m3-max-87827, in the image) named what changed once 4:2:2
textures are made:

- A linear or bicubic sample of a 4:2:2 texture filters the texels the lowered content decodes,
  in the shader's arithmetic. The texture now states PrecisionNote::BicubicFilterArithmetic as
  its static note (Texture::precision_note, as a block-compressed texture states its own), fixed
  by the format, so the note is announced where the texture is made and not only in the content
  lowered at the first dispatch.
- Metal takes a blit between a buffer and a 4:2:2 texture whose buffer rows are closer together
  than the region's rows are long (chroma-pair-copies, rows 30 bytes apart for a 32-byte row, an
  Apple M3 Max). The runtime refused it as no layout Metal takes. It is now
  Gap::ChromaPairsUse { cause: ChromaPairsGap::CloseRows }: one Vulkan copy region takes no row
  stride below its width (VUID-VkBufferImageCopy-bufferRowLength-09101), and one region a row
  would build it with no extra copy, which the README's known gap says. Planner's ruling: a gap
  in this pin, built when a guest meets it.
- The conformance cases declare the notices the rt side announces for them:
  bicubic-filter-arithmetic for every 4:2:2 case, and pixel-sampler-scaling for the sampling and
  gathering ones, through the fixture's runtime sampler slot.

REFUSALS.md and the API signatures regenerated.
2026-12-04 21:23:50 -08:00
Anees Iqbal e5d5698dc3 Conformance: the 4:2:2 case's docs name its private helpers without links
Rustdoc with -D warnings refused the public module doc's links to the private hashed and
linear_positions (job m3-max-87829).
2026-12-04 21:23:50 -08:00
Anees Iqbal bbacaa9a7f Runtime tests: the 4:2:2 device test prints its bound and address dispatches
Which buffer form the device took for the decoding kernels (rule 2's bound buffers or their
addresses) goes beside the chroma counters in each card's lines.
2026-12-04 21:23:50 -08:00
Anees Iqbal cfa1a825c7 Runtime tests: the 4:2:2 refusal test grants its read texture's index
Index 2 was not granted (job m3-max-87820, llvmpipe); the test now grants it per device, as the
read, sample and gather test grants its own.
2026-12-04 21:23:50 -08:00
Anees Iqbal c23c3ca34e Runtime tests: the 4:2:2 refusal test gives its read texture an index
A texture shaders read takes an index; the test made its plain 4:2:2 texture without one and met
Refusal::TextureIndex before the view it asks (job m3-max-87817, llvmpipe).
2026-12-04 21:23:49 -08:00
Anees Iqbal c4a205f9e5 Runtime: a 4:2:2 texture's unbuilt use is its own gap before the format query
A texture of GBGR422 or BGRG422 asked with render-target usage met the format query first, which
offers the bytes' R8G8 image no render-target use on any device, and answered Gap::TextureFormat
instead of Gap::ChromaPairsUse { cause: RenderTarget }. The use is now asked first, keyed by the
format as Metal's 4:2:2 rules are.

Found by the device test every_device_refuses_what_metal_refuses_of_four_two_two_textures on
llvmpipe (job m3-max-87813), whose read, sample and gather test passed there (chroma_contents +6,
chroma_launches +80).
2026-12-04 21:23:49 -08:00
Anees Iqbal 0558bb7979 Runtime: the test literals take handle_float_images; the 4:2:2 known gap and note docs say what is true now
The Draws and Interface literals of tests/indirect.rs and tests/compute.rs
missed the new field (job m3-max-87802, E0063). The README's 4:2:2 known gap
now states the content lowered for the texture, its counters and costs, and
the refusals and gaps; PrecisionNote::BicubicFilterArithmetic's doc and its
docs/API.md entry name a 4:2:2 texture's linear sample.
2026-12-04 21:23:49 -08:00
Anees Iqbal 6fe743aa73 Runtime: 4:2:2 textures are made, decoded by contents lowered for them, and refused as Metal refuses
A GBGR422 or BGRG422 texture is made (FormatEmulation::ChromaPairs, its image
R8G8_UNORM of the bytes), over a buffer as any 2D texture. Only a content
lowered for it reads its texels as Metal's:

- KernelKey carries a Chroma: the texture slots bound to a 4:2:2 texture per
  stage, and whether a stage may reach one through a handle while one lives
  (PipelineInterface::handle_float_images and Gauges::chroma_textures).
- A dispatch picks the kernel state's content for it beside the sRGB and word
  variants (ComputePipelineState::variant), a draw the state's content for its
  draws (RenderPipelineState::for_draws); both are made at the first need,
  counted in Metrics::translations_at_encode and Metrics::chroma_contents, and
  kept in the device's map of contents (LRU, KERNEL_ENTRIES), whose
  fill-past-capacity test is tests/kernel_map.rs's
  the_map_holds_its_cap_and_forgets_the_least_recently_used. A draw or
  dispatch on one counts in Metrics::chroma_launches. A state without either
  runs its own module as before.
- Refusal::ChromaPairs (metal-measured, Metal's own asserts): a type other
  than 2D (texture buffers included), an odd width, more than one level, a
  view.
- Gap::ChromaPairsUse: ShaderWrite (and unknown) usage, RenderTarget usage, a
  swizzle at the make, and a function compiled outside the runtime bound to
  one or reaching one through a handle (the consumer never hands the runtime
  such a kernel).
- Buffer::new_texture's doc states that Metal refuses a linear 4:2:2 texture
  and why the runtime takes one.

The device test now asserts the six kernel states' contents, the 80
dispatches on them and the live gauge, and a second device test the
refusals and gaps. docs/REFUSALS.md and basis.rs regenerated (the
TextureSwizzle row's site list was stale at the base and is current now);
the API signature table blessed. Not yet built.
2026-12-04 21:23:49 -08:00
Anees Iqbal af7d2e1632 Translator: the plan carries which slots and handles decode 4:2:2 bytes
The emission context has no lowering inputs: selection records
LoweringInputs::chroma_pairs in each texture slot's plan (SlotPlan::chroma) and
chroma_handles beside heap_extended (AccessPlan::heap_chroma), which the
decode reads. Fixes the E0609 errors of job m3-max-87777.
2026-12-04 21:23:49 -08:00
Anees Iqbal afec47efc2 Translator: a 4:2:2 texture is decoded only by a function lowered for its bindings
The specialization-constant gate weighed every float 2D sampling stage with the
dead decode arms (spirv::roll::weights counts every block), which moves the
roll, the kernels' helper path and the render stages' bound for pipelines that
never see a 4:2:2 texture. The decode is now a lowering input, as srgb_storage
and word_bound_buffers are:

- LoweringInputs::chroma_pairs names the texture slots bound to a GBGR422 or
  BGRG422 texture: each read, sample and gather of a float 2D sampled image
  there takes Metal's decoded texels alone, the order read from the slot's word.
- LoweringInputs::chroma_handles: each heap handle carries the 4:2:2 marks and
  each access through a handle branches on them.
- Without either nothing of the decode is emitted, so a function's module is
  the one it was. SpecKey::ChromaPairs is gone.
- StageInterface and PipelineInterface::handle_float_images state whether a
  function reaches a float colour image through a handle (the plan's
  heap_extended), which the runtime reads to choose the handles content.
- BicubicFilterArithmetic is recorded only where the input names the site's
  texture and the sampler may magnify linearly.
- The clippy errors of job m3-max-87748 are gone (the unused READ_WORDS, the
  indexed lanes).

ARTIFACT_FORMAT_VERSION 617 for the interface field. The API signature table
is blessed. New tests in src/tests/engine_chroma_pairs.rs: a slot named in
chroma_pairs decodes and validates on every committed profile and records the
note only for the linear-capable sample; a slot the kernel does not declare
and chroma_handles on a function without handles leave the module word for
word; a4_heap_sample under chroma_handles validates and differs. Not yet run.
2026-12-04 21:23:48 -08:00
Anees Iqbal 496be31c3b Translator: the 4:2:2 sample arm borrows its builder once at a time
Build fixes for 920324aeba (job m3-max-87745 failed its clippy on two borrows): border_bits takes the
context mutably, and the nearest arm makes its footprint before the decode.
2026-12-04 21:23:48 -08:00
Anees Iqbal 95f1391bb4 Translator: 4:2:2 textures held as their bytes, decoded under SpecKey::ChromaPairs (first build)
GBGR422 and BGRG422 are held as R8G8_UNORM at full width (FormatEmulation::ChromaPairs), two bytes
a texel, which copies move unchanged. Every float 2D sampled image's read, sample, gather, pixel
fetch and bicubic sample keeps the device's access and, where the stage's new
SpecKey::ChromaPairs holds and the texture's word names a 4:2:2 format, a branch computes Metal's
answer from the decoded texels (lower::texture::chroma, lower::sampler::chroma). A heap handle
carries the format's marks in place of its word bits under the same constant. SEMANTICS_VERSION
2395 (its final number in pin AC).

Not yet built: this commit is the first build's input; fixes follow forward.
2026-12-04 21:23:48 -08:00
Anees Iqbal c9f973f88e Conformance: the Apple M3 Max's recordings of the 4:2:2 linear samples and gathers
The four cases 0a26c673d9 added, recorded on the Apple M3 Max under macOS 27.0.1 (26A434), three
runs each with one outcome (job m3-max-87684 at 0a26c673d9):

- chroma-pair-texel-linear-samples-{gbgr422,bgrg422};
- chroma-pair-texel-gathers-{gbgr422,bgrg422}.

The job's tree showed only these four files new, so the four texel recordings taken before stay
current.
2026-12-04 21:23:48 -08:00
Anees Iqbal fe29e9f4a6 Runtime tests: 4:2:2 textures over a surface buffer, refused today
A device test of what the consumer's camera frames need: GBGR422 and BGRG422 textures made with
Buffer::new_texture over buffers laid out as 'yuvs' and '2vuy' surfaces (64x8 over Shared and
Private buffers at rows 128 and 192 bytes apart, and 640x480 at 1280 over a Private buffer, the
consumer's frame), each made in the form texture_copy_cause answers and the 640x480 one in place;
every texel read and nearest-sampled at its centre as Metal's decode (jobs m3-max-87650 and
m3-max-87653: own luma, chroma (3c + n + 2) >> 2 of its pair and the pair on its side, each code
c / 255 correctly rounded), each component gathered at every footprint corner, and linear samples
at the corners and a quarter between texels within f32 rounding of the decoded texels' mean.

It fails today at the texture's make, Gap::TextureFormat, on every device: the red half of the
4:2:2 form that follows.
2026-12-04 21:23:47 -08:00
Anees Iqbal 0d406e1fd8 Conformance: 4:2:2 linear samples and gathers, refused on rt today
chroma_pairs gains two accesses of each 4:2:2 format, so the form that makes these textures is held
to Metal's filtered and gathered answers as well as its reads and nearest samples:

- chroma-pair-texel-linear-samples-{gbgr422,bgrg422}: sample() through a linear clamp-to-edge
  sampler at 552 positions (a quarter past each texel toward its right neighbour, the corner of
  each 2 by 2 footprint, the centres of rows 0 and 7, and u at 0, 1, -0.25 and 1.25 in rows 0 and
  15);
- chroma-pair-texel-gathers-{gbgr422,bgrg422}: gather() of each component through the nearest
  clamp-to-edge sampler at the corner of each 2 by 2 footprint, 256 positions, one dispatch and
  site a component.

Both read a texture of hashed bytes, whose neighbouring pairs' chroma do not all differ by
multiples of 4, so Metal's (3c + n + 2) >> 2 rounding shows; the step pattern the read and the
nearest sample recordings were taken over gives 3c + n a multiple of 4 at every texel
(the_hashed_texture_shows_the_decode_rounding). The accesses of one entry keep their recorded call
order and inputs, so the four existing texel recordings stay current.

The four cases are refused on rt at every venue today (Gap::TextureFormat at the texture's make),
the ledger's rows say so; their Metal recordings follow from the M3.
2026-12-04 21:23:47 -08:00
Anees Iqbal 8e895593e1 Docs: NVIDIA's free holds say only what was measured; the unsourced per-MiB figure goes
The runtime's README (Known gaps of memory blocks), memory.rs's IDLE_AGE_NANOS doc and
counters.rs's Metrics::submissions_during_frees doc each said that freeing host-visible memory
takes about 1.1 ms per MiB on the NVIDIA cards measured in Thunderbolt enclosures (the README also:
about 0.5 ms per 16 MiB on an internal card, and that the free holds any submit for its length).
The only record of those figures is 0280c19285's message, with no job on file. They go. The README
line now says a driver may hold a submit for a free's length and points to the measured NVIDIA rows
below it; the two doc comments keep only "a driver may hold".

The hold paragraph opened with "NVIDIA's Linux driver holds a submit ...", stated for every NVIDIA
driver. Its evidence is an RTX 3090 under 620.70.06 (rtsweep's standalone program, 9e250379d3 and
ef875741cc, and the consumer's walk m3-max-57463, 028a764c68) and an RTX 2080. It now names the
cards measured.

The paragraph's walk sentence keeps its figures (frees of imported blocks, 0.4 to 2.9 ms each and
52 in one second, held four submits for 5.2 to 6.9 ms). The walk's raw log is gone, but its derived
table is on file: the consumer's take-site table for m3-max-57463 (rt 2233c8962d, an RTX 3090,
336 s, allocate, free and submit timers on rt's own clock), sent to us on 11-20 and kept in the
consumer's session record. Its line reads: "73.5 s, four submits of 5.2-6.9 ms: 3-5 block-own
vkFreeMemory each, 0.4-2.9 ms apiece, on m2v-blocks. 97-100%. By stamp these are guest-memory
import frees, 52 in that second."

The per-claim source audit was lane uniarm's (its commit e2e4ae1bb7 on the parked
steelbrain/uniarm-landing, whose doc-comment hunks this takes unchanged). No code changes; the
README text names no job.
2026-12-04 21:23:47 -08:00