A dispatch takes what its state planned for its bind state's shape and class of grids while the
state keeps it among its latest PLANNED. A stream of dispatches over buffers of several length
classes in grids of several classes cycles more pairs than 4: the bench's moved, heap, ragged
shape of three length classes cycles 6 through 4 entries, so a fifth of its dispatches planned
again (plan_now 4.0% of the encoding thread on msi lavapipe, m3-max-33099). In the consumer's
profile of its compositor's fix-index encoder on the XTX (hvP2, at 2cdfa840b5) plan_now,
BindState::shape and position_of_shape were 25.2% of dispatch_threads, 64% of its dispatches
planned and 47% made their shape anew.
PLANNED goes from 4 to 16. Each Planned carries its shape's key beside its used resources
(BindShape::key_beside_used). A lookup (position_of, used by planned_shape and planned_of)
compares the latest IN_PLACE = 4 entries in place, as the state compared its four before; only
where none is the state's shape does it work out the state's key (which folds every argument
sampler's) and compare whole only the remaining entries of that key. planned_for's fallback,
past the Arc match, compares whole only entries of the shape's key. PLANNED's doc states the
bound: about 290 bytes an entry, and at most PLANNED entries' variants and region pipelines kept
past the state's memos. The dispatch_chain bench's --classes takes up to 12.
Test: grid_classes::shapes_and_classes_in_turn_each_plan_once (six shape-class pairs in turn for
six rounds: each plans at its first dispatch alone, every later one takes its plan, every slice
Metal's words); at PLANNED=4 it fails (grid_classes.rs:346).
Verified at 9b5717e840 (m3-max-33158, msi): clippy plain, m2v_cpu_icd and m2v_gpu 0, Rustdoc 0,
106 lavapipe tests of the compute paths, the PLANNED=4 control failing. Profile (m3-max-33180,
msi lavapipe): 48 samplers, 3 classes: no key pass, plan_now gone; 12 classes (24 pairs): the
keyed path runs. XTX A/B (m3-max-33162, 5 interleaved rounds, load 23, median ns a dispatch,
dev 0ab6927fce / this): no samplers 3 classes 4448/4272; 48 samplers 3 classes 5180/5122, 12
classes 7708/6423; 200 samplers 3 classes 6408/6435 (flat); plain 3753/3554; no samplers 12
classes noisy (median 6151/6547, min 5839/5220, least encode+commit 6166/5543).
dispatches_planned_as_before 0.80 -> 1.00 at 3 classes; at 12 classes 0.61 reused where dev
planned every dispatch.