BRW's scoreboard reserved and visited 512 GRF dependency entries on every supported generation. Xe3 needs all 512. My RPL-S system can address 128.

The profile

A full shader-db profile put propagate_block_scoreboards() at 5.10% of P-core cycles and 5.93% of E-core cycles. Its merge, shadow, transport, and equality operations walked the full array.

Gfx12 / Gfx12.5   128 × 32-byte GRF units
Xe2               256 × 32-byte GRF units
Xe3               512 × 32-byte GRF units

On Gfx12, each traversal carried 384 impossible entries. Per-block delta, input, and output scoreboard arrays carried the same unused state.

Three fixed sizes

The candidate makes the GRF count a template parameter and selects one specialization when dependency gathering begins:

ver >= 30  → scoreboard<512>
ver >= 20  → scoreboard<256>
otherwise  → scoreboard<128>

The dependency algorithm does not change. Existing loops already use the array size, so reducing the representation removes both traversal and storage. A boundary test touches the last addressable register unit on Gfx12, Xe2, and Xe3.

Paired shader-db runs

I ran five paired full-corpus comparisons at -j20 on an RPL-S Iris system.

                         main       candidate    change
task-clock           85194.39 ms   79949.94 ms   -6.16%
P-core cycles          302.77 G      285.30 G    -5.77%
E-core cycles          240.35 G      224.93 G    -6.42%

The hotspot fell to 1.42% of P-core cycles and 1.60% of E-core cycles. A five-run single-thread subset improved by 3.80%. All 26,884 stable full shader-db output lines were identical in every pair.

The code-size tradeoff

Three template specializations add 47,462 bytes to libgallium text, or 0.14%. I also tried a runtime-sized contiguous arena. It removed the text increase but touched about 2.4 times as many diff lines and was 0.23% slower than the template candidate in the full runs.

The arena saved text, but not time. It also made the patch about 2.4 times larger, so I kept the template version.

Checks and scope

The configured Mesa suite passed 106/106. A normal build passed all 294 BRW compiler tests, and the 44 scoped scoreboard tests passed under ASan and UBSan. The dynamic export list and SONAME were unchanged.

The timing measurements are from RPL-S. Xe2 and Xe3 are covered by generation-boundary tests, not hardware benchmarks.

The patch is open as Mesa MR !43396 at commit 3306a9e6ae7. It is not merged.