Ports dev-perf 7028c0d92a onto development. On a device that samples
through Metal's own texture unit (MoltenVK) a texture slot a function
converts to `half` declares `SpecKey::PlainHalfTexels` and
`SpecKey::UnmeasuredTexels`, each with an arm that serves every bound
class exactly (0: the class routine; 0: no instruction reads it). A
state's creation predicts no texture bound, so a draw binding an
unmeasured class (BC4 to BC7, the linear ASTC formats among them) keyed
apart from the one pipeline the creation made, compiled its own at the
draw, and its command buffer waited for it (past the commit bound the
draw is dropped).
The residual form becomes the general form (`render/residual.rs`):
RangeAtBindOffset, PlainHalfTexels and UnmeasuredTexels at 0. A state's
creation makes its predicted key's general form, waited as before, and
where the predicted key differs hands the predicted key itself to the
pool right after, at the rank nothing waits for, not waited for. A draw
whose own key is not made takes the general form at once while its own
is made, as the residual form did. graphics_pipeline_now and
made_or_make now say whether the pipeline is the key's own, so a made-now
draw that took the general form keeps nothing in its encoder's memo.
Adapted to development (development wins):
- Development's native half-texel rounding (ae70850097, not on dev-perf)
made every class but a YCbCr field on the grid 8192 plain, so the
16-bit normalized and 32-bit float classes now key as predicted. That is
why the 10-28 attempt saw other counts: dev-perf's lane changes expected
an RGBA16Unorm draw to take the general form (it takes the predicted key
on development), and its general_form_drawn test's first positioned
RGBA16Unorm draw made its own (PlainHalfTexels 1) key, so the RGBA8Unorm
draws found that made and took no general form (0 of 2). The lane test
now guards the idea with a BC4RUnorm draw (an unmeasured class).
- ce02b68f23 (general_form_drawn) is not ported: on development no
made-now draw path reaches a made general form. A positioned key's
general form is never made (no base-variant class keys PlainHalfTexels
0); a state for indirect command buffers refuses a fragment function
with a direct texture argument (Metal: "Fragment shader cannot be used
with indirect command buffers", seen on the M3); rerouted draws run the
extended shadow's variant. The own-flag change stays, unguarded by a
device test.
- No dev-perf measurement is quoted: its GPU-time and creation figures
were taken with another plain-class set and are not re-measured here.
The pipeline-creation bench is gone from development and not restored.
- pipeline_creation's pooled-making count (draw(1), f5cfcc4f3c) holds
under the general form: the format draws take the predicted key or,
while the pool still makes it, the general form, neither pooled.
Lane tests: made_at_creation's half-reading creations settle the pool
and expect 2 makings on Metal-sampler devices (1 elsewhere); new
a_draw_of_an_unmeasured_class_takes_the_general_form_its_creation_made;
ycbcr_textures' creation-made test settles the pool before counting.
Unit tests tests::general_form. Docs: residual.rs, predicted.rs,
API.md's general-form bullet, WorkCounts::residual_form_* docs.
RUNTIME_VERSION 1702 -> 1703.
Verified on this Mac (Apple M3 Max, MoltenVK 1.4.2), --cfg m2v_gpu,
under maclock and memcap: 212 device tests of the modules that count
pipeline makings (made_at_creation, pipeline_creation, ycbcr_textures,
creation_times, draw_work, framebuffer_fetch, kept_variants, restart,
runtime_data lanes; creation_prediction_kinds, creation_split,
deferred_calls, descriptor_key_*, draw_shape_notices, render_*,
tile_pending, tile_rebind_making_wait, twin_flights,
uniform_bind_offsets, pipeline_wait_order, dispatch_pending,
pool_room_creations, rebind_making_wait, pending_rebind, general_form):
211 pass; the one failure,
ycbcr_textures::a_ycbcr_sample_through_an_unmeasured_filter_is_announced,
is recorded failing on development before this change. Sabotage: with
the creation making the predicted key alone, 3 made_at_creation tests
FAIL (1 creation making vs 2); with the draw looking up the residual
form in place of the general form, the BC4 test FAILS ((0,0,0) vs
(1,1,1): no general form drawn); restored, PASS. Unit and check tests
205/205 (general_form, fast_paths, catalogue, degradation,
api_signatures, api_surface, profile). Clippy -D warnings plain and
--cfg m2v_gpu (workspace, all targets, all features) and rustdoc
-D warnings clean.
Conformance replay on the M3: case verdicts identical to development's tip
over four passes each. One cost over (render-then-sample-magnified-nearest,
pipelines_per_pipeline_state 4 vs 2) appeared in one of four passes, never
at the baseline; run alone, both read 4 over 2 states.
RUNTIME_VERSION renumbered at landing: 1706.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 5c51f5b0f9, then a9f25c50bb (the re-pin).