Repository navigation
agx: bound AGX3 ILP schedule by tile-store payload bank - #1255
Conversation
On AGX3, ST_TILE reads its payload from a bounded low-register bank (agx3_tile_store_bank(), 16/32/64 halves) with natural power-of-two alignment above agx_reserved_registers(). Previously, only AGX3B skipped fragment sample hoisting when a block had multi-sample tile stores to the same pixel offset; on AGX3C (M5), ILP sample hoisting/interleaving on layered 8x MSAA RGBA32 reload shaders kept four 8-half ST_TILE payloads (32 halves) live simultaneously ahead of wait_pix + st_tile, overflowing the 16-half bank and failing shader compilation with 'tile-store payload bank overflow'. Check live ST_TILE payload bank feasibility directly inside ilp_schedule_block() for all AGX3 non-preamble fragment shaders before committing a candidate order, replacing the AGX3B-only special case. Reject any candidate whose simultaneously live ST_TILE payloads cannot pack into [agx_reserved_registers(), agx3_tile_store_bank()) when the original order fits (or with higher peak demand than the original order). Add AGX3C (G17S/G17G) layered 8x MSAA RGBA32 reload regression tests to test-bg-shader-schedule.cpp. Fixes #1253 Signed-off-by: DjDeveloperr <hey@djdev.me>
agx_ra() asserts that all sources of a COLLECT have matching size. agx_immediate() and agx_zero() produce 16-bit operands, while coords and layer are 32-bit; materialize 32-bit immediates with agx_mov_imm() so the layered 8x RGBA32 reload test passes assert-enabled builds too. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
|
…d test Emit agx_mov_imm() before agx_collect_to() so the collect reads an already-defined SSA temporary, and pack 3x32-bit coordinates matching AGX_DIM_2D_MS_ARRAY width validation. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
|
There was a problem hiding this comment.
Verdict: FINISH, then merge at 7856a05713ba.
Blockers: Please identify the commit used for the J714s 3/3 reproducer pass, and post the exact-head J714s run if that result came from an earlier build.
Checked: The scheduler compares original and candidate liveness against the allocator’s existing bank and reserved prefix. The corrected fixture supplies three 32-bit collect operands and passes all seven Clang assert scheduler cases at this commit. Exact-head CTS passes on J316s, J700 and J615. The configured predicate follows AGX3 fragment shader execution and tile-store bank eligibility.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 7856a05713ba994f861852e3e4958668cf4b438a (code is ready; the merge waits only on an exact-head J714s row)
Blockers: none
Checked: Read the whole diff, body and comments. The Clang assert failure reported at 90b270bd5443 is fixed at this head: the 8x RGBA32 fixture now builds a three-operand 32-bit collect, and the full drm-shim suite passes with -Db_ndebug=false under Clang. The new bank check simulates the live ST_TILE payloads with natural power-of-two packing above agx_reserved_registers() for both the source order and the candidate order, and it only rejects a candidate that overflows when the source order fits, or that overflows with a higher peak. That subsumes the removed AGX3B-only multi-sample skip, and the existing G17P/G16G background-reload and multi-sample tests still pass under the general check. It is keyed on ISA encoding plus fragment stage and adds no chip or board gate. The new tests fail without the scheduler change and pass with it. The exact-head rows from J316s, J700 and J615 are in #1255 (comment). The J714s 3/3 repro result in the body predates this head, so a J714s rerun of dEQP-VK.api.image_clearing.core.clear_color_attachment.multiple_layers.r32g32b32a32_*_sample_count_8 at 7856a05713ba is the one item left before merge.
Non-blocking: ilp_tile_store_bank_overflows() walks every instruction in the shader each time a block is scheduled. That is fine at today's shader sizes, but the width table could be built once per agx_ilp_schedule() call.
Evidence
- Gate:
7856a057merged intoaurora-wipa58f52b53bb1(clean merge-tree), x86 drm-shim build, Clang,-Dbuildtype=release -Db_ndebug=false,meson test --suite asahi --suite poly: 338/338 OK. - Mutation: the same tree with
agx_pressure_schedule.creverted to theaurora-wipversion:BgShaderSchedule.*gives 5 passed and 2 failed (Layered8xRgba32ReloadKeepsTileStoreBankOnG17S/G17G: 8 loads hoisted before the first tile store; payloads at halves 16, 24, ... 56 against the 16-half bank). With the PR's file it is 7/7.
Summary
On AGX3,
ST_TILEreads its payload from a bounded low-register bank (agx3_tile_store_bank(), 16/32/64 halves) with natural power-of-two alignment aboveagx_reserved_registers(). Previously, only AGX3B skipped fragment sample hoisting when a block had multi-sample tile stores to the same pixel offset (ilp_block_has_multi_sample_tile_stores()). On AGX3C (M5), ILP sample hoisting/interleaving on layered 8x MSAAR32G32B32A32_{SINT,UINT,SFLOAT}reload background shaders moved four 8-halfST_TILEpayloads (32 halves) ahead ofwait_pix+st_tile, overflowing the 16-half bank and failing compilation withtile-store payload bank overflow.This replaces the AGX3B-only special case with a direct tile-store payload bank check inside
ilp_schedule_block()for all AGX3 non-preamble fragment shaders:order[], compute liveST_TILEpayload packing feasibility in[agx_reserved_registers(ctx), agx3_tile_store_bank(ctx))using natural power-of-two alignment for both the original order and the candidate order.ST_TILEpayloads overflow the bank when the original order fits (or with higher peak demand than the original order).G17SandG17G) layered 8x MSAARGBA32reload regression tests (Layered8xRgba32ReloadKeepsTileStoreBankOnG17SandLayered8xRgba32ReloadKeepsTileStoreBankOnG17G) totest-bg-shader-schedule.cpp.Fixes #1253
Tested
Verified on J714s (Apple M5 Pro / G17S B1, AGX3C, kernel
7.3.0-m5-cdirect16) vsaurora-wip(99658583598f):#1253CTS repro (dEQP-VK.api.image_clearing.core.clear_color_attachment.multiple_layers.r32g32b32a32_{sfloat,sint,uint}_64x11_sample_count_8):aurora-wip: 3/3 Fail2,499cases): 1,243 Pass / 1,256 Skip / 0 Fail--suite asahi(including all 7BgShaderSchedule.*tests): 336/336 Passgpubench-vkMSAA=4 ABBA non-regression:render.deferred mode=tile msaa=4 res=1080p:gpu_us156.8 -> 156.9 us (+0.05%), CRC6dc74b48identicalrender.postfx msaa=4 res=1080p:gpu_us150.2 -> 150.2 us (+0.00%), CRC668d6f0aidenticalonline=1,crashed=0,0new GPU faults.Risk
Low. Only rejects candidate AGX3 fragment ILP schedules that would exceed
[agx_reserved_registers(), agx3_tile_store_bank()), preserving full ILP hoisting for single-target and small-payload fragments (NormalSingleStoreFragmentStillHoistsSamplesstill hoists all 4 loads;render.postfxandrender.deferredMSAA=4 are unchanged).Not yet
90b270bd5443, droppingconston 3u_sparse_bitset *helper parameters for Clang-Werror) Clang assert--suite asahi+ multi-gen (G17P/G16G/G17G/G17D) verification.