A row of floats written four at a time from a float4, with its tail guarded, stores the first
float in one block and the other three in the block its branch takes when the row holds them.
Each store was its own word store. Now the specialized entry moves such a block's last store
into both successors of its branch, where one of them opens with the three stores after it
(`lower::access::quad::sink`). Selection then finds, in one block, four plain word stores at
byte offsets k, k+4, k+8 and k+12 from one base with nothing between them that touches memory,
all reaching one slot (`quad::plan`). The last of them emits the four; the others emit nothing.
At emit each invocation tests the first word's offset: where it is a multiple of 16 and the 16
bytes pass the slot's containment check, the four words are one uvec4 store (through the slot's
uvec4 view where the kernel binds its buffers, at the device address with Aligned 16
elsewhere); otherwise the four word stores run as selected, each checked by itself. At a device
address the 16 bytes are checked in the shader, so a store that straddles the buffer's end keeps
every in-range byte. One form on every device: the memory decides only where the store goes, as
for every other access. Under the descriptor profiles, where lockstep orders lanes, a barrier it
puts between the stores keeps them words.
engine_word_phases's alignment test now allows the two tested 16-byte stores of vwp_words's
two runs of four word stores. SEMANTICS_VERSION 2322 (development holds 2321): the SPIR-V of
such kernels changed.
Verified: engine_store_quad, engine_word_phases and the access tests pass on the interpreter
in both forms at bind offsets 0, 4, 8 and 12 (m3-max-80331, m3-max-80352); clippy in all three
configurations, rustdoc, the runtime's suite on lavapipe (937 passed, 3 skipped) and the
translator's (3404 passed, 37 skipped, the tables a bless is due for left out) at the change
(m3-max-80386).
Timed with the harness's row_tail workloads, the harness commit against this change, the arms
alternated in one job per card; GPU time, the median of the rounds' medians:
- NVIDIA GeForce RTX 3090 (m3-max-80449, 4 rounds): the Shared rows fell from 46.3 to 2.12 ms
(224 floats a row), from 52.4 to 3.29 ms (49) and from 24.8 to 19.4 ms (27,730, bimodal in
both arms); the Private rows took 0.2 to 0.4% longer.
- AMD Radeon RX 7900 XTX (m3-max-80450, 4 rounds): every row within 1.1% of the base.
- AMD Radeon 780M (m3-max-80482, 8 rounds): the times fall in two clock states, the change's
runs in the slower one in 5 of 8 rounds and the base's in 2 to 4; within a state the change
takes 0.973 to 1.014 of the base's time.
Not run on an Intel card. Those jobs ran an earlier build of this change on an older
development; its row_tail module equals the one at this branch's last commit byte for byte on
the committed rtx50, lavapipe, 780M and Iris Xe profiles (m3-max-80707, m3-max-80705).