Repository navigation
borealis: incremental HAL200 FS PPP update, fast draw flush, and graphics root trimming - #706
Conversation
|
Thanks, the numbers on Neo look good. Before this goes in I have concerns about scope, chip selection and coverage.
Test rows needed at bafac29, beyond the Neo subsets already posted:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Exact-head M4 hardware verification (
Assisted-by: LLM (Gemini:4 Neon) |
|
Thanks, that's a solid M4 row at the exact head: 0 fails over 1,612 cases, bit-exact CRCs, and a real ABBA win on bindless UBO and MDI. It covers G16G. The head is still bafac29, though, so the code points from my last comment are open:
Assisted-by: LLM (Claude:Opus 5.5) |
…hics root trimming On native HAL200 (G16G / G17P) command streams, every draw that changes push constants, dynamic buffers, vertex buffers, draw parameters, or draw ID previously rebuilt and re-emitted the full 68-byte bind tail + 4-byte draw-state selector (allocating a 188-byte state block, relocating 8 offsets, comparing scissor/depth-bias tails, and making the GPU re-fetch all 9 PPP records), ran the full dynamic-state flush, and uploaded the full 1520-byte root descriptor table. Add a shared agx_chip_native_hal200() capability predicate covering AGX_CS_GENERATION_HAL200 on the native AGX3 path (G16G and G17P) while keeping unverified G15 (M3, AGX_CS_GENERATION_G15) streams on the existing full-tail / full-root path, and apply three complementary optimizations uniformly across HAL200: 1. Latch the last published HAL200 bind tail per VDM stream (struct hk_cs). When subsequent ordinary draws in the same stream keep every non-FS PPP record unchanged, elide the tail completely (0 bytes) when the fragment program is unchanged (e.g. draw-ID / base-param / VBO-only changes) or emit a single 8-byte VDM PPP State Update pointing to a 64-byte-aligned 28-byte HAL200 fragment record when only the fragment program moved. Invalidate the latch on stream links, viewport flushes, robust-index slots, and full graphics-state invalidation. 2. Add a guarded fast path in hk_flush_dynamic_state() for HAL200 streams when only root descriptors, vertex buffers, draw parameters, or draw IDs changed, sharing vertex-attribute root update and draw-param / draw-ID upload helpers with hk_flush_dynamic_state_slow(). 3. Apply root-descriptor trimming uniformly on agx_chip_native_hal200() (G16G and G17P), extending hk_nir_root_size() measurement to hardware vertex and fragment stages (floored at offsetof(push) to preserve all driver prolog/epilog loads) and forcing a re-upload if a later shader needs a larger root than currently uploaded. Tighten the G17P drm-shim stream validator to track bind-tail latch state (reset on stream links and non-FS PPP updates), reject tail elision when non-pipeline VDM state changes or no bind tail is latched, and require 64-byte alignment plus unchanged non-program slot-1 fields on standalone 28-byte FS PPP updates. Add hk-g17p-bind-tail-state-change to verify under drm-shim validation that push-constant-only draws take the incremental 28B FS PPP path while non-FS PPP state changes (scissor, viewport, cull mode, depth compare op, and blend state) always re-emit the full bind tail. Extend test-hk-root-size and hk_cpu_upload_bench to cover the offsetof(push) floor, hk_gfx_root_descriptor_size(), root growth detection, and G16G/G17P vs non-HAL200 gating. Signed-off-by: Diljit Singh <hey@djdev.me>
bafac29 to
6eaea73
Compare
|
Thanks for the thorough reviews in
Assisted-by: LLM (Antigravity:Gemini 4 Neon) |
|
Thanks, this addresses everything from my earlier comments:
One row is still missing. On G16G, graphics and compute root trimming are new at this head (the earlier M4 row ran with full roots). Please post the M4 row at 6eaea73 when it's ready. The Neo full-group rows were run at 733b49ff, which isn't on the remote. If that tree really is identical in the driver, pushing it (or re-running a short subset at 6eaea73) would let us check. Assisted-by: LLM (Claude:Opus 5.5) |
|
Exact-head MacBook Neo ( 4-Round Interleaved ABBA (
|
| Benchmark | Depth | Base wall (us) | Head wall (us) | Wall Speedup | Base GPU (us) | Head GPU (us) | GPU Speedup | CRC |
|---|---|---|---|---|---|---|---|---|
render.mdi (draws=2048, bindless=1024) |
1 | 717.4 | 492.6 | 1.456× | 432.2 | 267.8 | 1.614× | b9cce2ef EXACT |
render.mdi (draws=2048, bindless=1024) |
2 | 323.0 | 243.2 | 1.328× | 427.2 | 256.7 | 1.664× | b9cce2ef EXACT |
render.bindless_ubo (draws=2048, ubo_vec4) |
1 | 1041.7 | 851.8 | 1.223× | 544.9 | 421.2 | 1.294× | 57e7bedd EXACT |
render.bindless_ubo (draws=2048, ubo_vec4) |
2 | 570.3 | 451.2 | 1.264× | 537.9 | 413.2 | 1.302× | 57e7bedd EXACT |
Full-Group Vulkan CTS at exact 6eaea736177f (1,792 Pass / 0 Fail / 173 NotSupported)
dEQP-VK.dynamic_state.*(671): 531 Pass / 0 Fail / 140 NotSupporteddEQP-VK.pipeline.*push_constant*(437): 409 Pass / 0 Fail / 28 NotSupporteddEQP-VK.api.command_buffers.*secondary*(19): 17 Pass / 0 Fail / 2 NotSupporteddEQP-VK.multiview.*(838): 835 Pass / 0 Fail / 3 NotSupported
(Exact-head M4 G16G row at 6eaea736177f is queued on the M4 Mac mini lane.)
Assisted-by: LLM (Antigravity:Gemini 4 Neon)
|
Exact-head M4 (
(Note: Assisted-by: LLM (Gemini:4 Neon) |
|
Thanks. That is the M4 (G16G) row at 6eaea73 against base: 2,049/2,049 CTS including the new compute, shader_object, indirect dispatch and binding_model cases, 0 faults or recoveries, and every checked CRC exact in the ABBA. It covers the first-time G16G root trimming. With the Neo row on the same head, this is approved from my side. Assisted-by: LLM (Claude:Opus 5.5) |
|
Merged into All merge gates green on exact head
Assisted-by: LLM (Google:Gemini 4 Neon) |
Summary
On Borealis verified HAL200 GPUs (
G16G/G17P), every draw that updates push constants, dynamic uniform/storage buffers, vertex buffers, draw parameters, orgl_DrawIDpreviously:hk_flush_dynamic_state_slow()path; andThis PR adds three complementary optimizations gated uniformly on a single verified HAL200 capability predicate (
agx_chip_native_hal200()—G16G+G17P, excluding unverifiedG15G/S/CM3 soG16GandG17Pexecute the exact same codepath):src/asahi/lib/agx_chip.h):agx_chip_native_hal200()coveringAGX_CHIP_G16GandAGX_CHIP_G17P(excludingG15G/S/CM3 where tail-less VDM state updates and standalone 28-byte FS PPP updates are unverified).hk_cmd_buffer.c/.h,hk_cmd_draw.c,hk_cmd_upload.c,hk_shader.c).hk_cmd_buffer.h,hk_cmd_buffer.c,hk_cmd_draw.c):struct hk_cs::g17p_bind_tail.hk_upload_usc_wordswhenpreparedmatches) when the fragment program is unchanged (e.g. draw-ID, draw-parameter, or VBO-only changes).0x00000700, compact 32-bit offset) pointing to a 64-byte-aligned 28-byte HAL200 fragment PPP record when only the fragment USC program moved (e.g. push-constant / dynamic-UBO / push-descriptor base updates; includes comment notinghk_upload_usc_words()detects push-descriptor set base movement via its returned USC address).g17p_native_ppp_handledfrom*g17p_native_bind_tail_emitted_outso elided draws skip both legacy PPP fallthrough and the 4-bytedraw_state_offsetselector.cs->g17p_bind_tail.validon VDM stream links (hk_ensure_cs_has_space()), viewport flushes (hk_flush_vp_state()), robust-index slots (hk_emit_robust_index()), and full graphics state invalidation (hk_cmd_buffer_dirty_all()).hk_cmd_draw.c):hk_flush_vertex_attribs_root()andhk_flush_draw_params_and_id()called by bothhk_flush_dynamic_state_slow()andhk_g17p_flush_dynamic_state_fast(), preventing drift between paths.hk_nir_root_size.h,hk_shader.c,hk_cmd_upload.c,hk_cmd_buffer.h):hk_nir_root_size(), floored athk_root_descriptor_offset(push)to preserve all driver prolog/epilog loads.root_dirtywhen switching to a shader needing a larger root thancmd->state.gfx.uploaded_root_size.asahi_g17p_stream_validator.c/.h,asahi_noop.c,g17p_vulkan_bind_tail_state_change.c,test-hk-root-size.c,hk_cpu_upload_bench.c):bind_tail_latched,have_latched_vs,latched_vs,latched_fs_slot,elided_bind_tails, andincremental_fs_ppp_updates: resets latch onSTREAM_LINKand non-FS PPP updates; rejects bind-tail elision when unlatched or when non-pipeline VDM state changed; rejects standalone 28-byte FS PPP updates unless latched, 64-byte aligned, valid slot 1, and all non-program slot-1 fields match the latched record.hk-g17p-bind-tail-state-change(src/asahi/vulkan/tests/g17p_vulkan_bind_tail_state_change.c) executes 8 draws in one render pass (initial draw, push-constant-only update,vkCmdSetScissor,vkCmdSetViewport,vkCmdSetCullMode,vkCmdSetDepthCompareOp, blend-enabled pipeline switch, and final push-constant-only update) and asserts exactfull=6, elided=2, fs_ppp=2underASAHI_SHIM_VALIDATE_G17P_STREAM=1, proving every non-FS PPP state change re-emits the full bind tail.test-hk-root-sizeto cover theoffsetof(push)floor,hk_gfx_root_descriptor_size(), root-growth re-upload trigger, missing-footprint full-root fallback, andagx_chip_native_hal200()(G16G/G17PvsG15G/non-HAL200).Verification (R2 —
6eaea736177f)Host CI, Policy & drm-shim Validator Tests
DEFAULT_BRANCH=aurora-wip ./.github/aurora/agent-policy.sh pr HEAD: PASS (PR head is clean)FEDORA-CI 6eaea736177f05d7c055aff7046586e99c65c2b3: 156 Pass / 0 Fail / 0 Timeout / 0 Skipped-Dtools=drm-shimtest suite onfedora(6eaea736177f): 3/3 PASShk-g17p-bind-tail-state-change: OK (8 draws, 0 indexed, 8 state updates (2 elided, 2 fs_ppp),bind-tail counts matched: full=6 elided=2 fs_ppp=2)hk-g17p-compressed-layer-copy: OKhk-g17p-tess-batch-stream: OK (256 draws, 256 indexed, 256 state updates (255 elided, 255 fs_ppp))MacBook Neo (
G17P B1) — TVB-Overflow Partial Render Stress Proof (basevshead)Standalone Vulkan probe rendering overlapping alpha-blended screen-covering triangles inside a non-trivial scissor rect across
512–2048push-constant draws in a single render pass (withCOLOR_ATTACHMENT_WRITE -> TRANSFER_READ+TRANSFER_WRITE -> HOST_READbarriers):512 draws × 64 tris(32,768tris)0xbcb9de68/0xff402010/0x20e3e6d7(358.1 ms)0xbcb9de68/0xff402010/0x20e3e6d7(347.9 ms)kfault_delta=01024 draws × 128 tris(131,072tris)0xd9ee7eaa/0xff402010/0x20e5f0dd(1514.9 ms)0xd9ee7eaa/0xff402010/0x20e5f0dd(1540.3 ms)st=r1024:v1024:n1024:p1022(1,022 incremental FS PPP updates),kfault_delta=02048 draws × 256 tris(524,288tris)0xbc0a3015/0xff402010/0x20e5f0dd(6474.0 ms)0xbc0a3015/0xff402010/0x20e5f0dd(6602.8 ms)kfault_delta=0MacBook Neo (
G17P B1) — 4-Round Interleaved ABBA + Multi-Pass Scene CRC Parity (c0b51ef245vs R2)All runs verified with 100% bit-exact CRCs,
MESA_SHADER_CACHE_DISABLE=true,sleep_guard=active,pmu=30 00,kfault_delta=0,avc_delta=0:render.mdi(draws=2048, bindless=1024)b9cce2efEXACTrender.mdi(draws=2048, bindless=1024)b9cce2efEXACTrender.bindless_ubo(desc_buf, draws=2048)57e7beddEXACTrender.bindless_ubo(desc_buf, draws=2048)57e7beddEXACTrender.bindless_ubo(ubo_vec4, draws=2048)57e7beddEXACTrender.bindless_ubo(ubo_vec4, draws=2048)57e7beddEXACTMulti-pass scene parity (2 rounds each,
depth=2, base vs head):render.postfx(1440p, msaa=1):ce5a5fe7EXACT (neutral timing)render.postfx(1080p, msaa=4):668d6f0aEXACT (neutral timing)render.deferred(dram):2cfe9a54EXACT (neutral timing)render.shadow(d32f, 2048×2048):c0fb9993EXACT (neutral timing)MacBook Neo (
G17P B1) — Full-Group Vulkan CTS (Zero Caps)Grand Total:
163,089 Pass / 0 Failacross356,950full-group mustpass cases (plus6,695 Pass / 0 Failonvk-renderpasses.txt),pmu=30 00,sleep_guard=active,kfault_delta=0,avc_delta=0:dEQP-VK.dynamic_state.*dEQP-VK.pipeline.*push_constant*(monolithic, library, fast_linked, shader_object)dEQP-VK.api.command_buffers.*secondary*dEQP-VK.multiview.*dEQP-VK.draw.*(draw.renderpass+draw.dynamic_rendering)dEQP-VK.renderpasses.renderpass1.*dEQP-VK.renderpasses.renderpass2.*dEQP-VK.renderpasses.dynamic_rendering.*mustpass/main/vk-default/shader-object/*.txt(all 10 groups incl. 240,687-caserendering.txt)dEQP-VK.shader_object.performance.*(30 timing-ratio micro-checks) behaves equivalently toaurora-wipbaseline (base c0b51ef2:9 Pass / 15 Fail / 6 QualityWarning; R2:12 Pass / 15–16 Fail / 1–2 QualityWarning).G16G) R2 verification row incoming from the M4 Mac mini lane (G16Galready passed1,612/0+1.403×wall /2.044×GPU on R1).Assisted-by: LLM (Antigravity:Gemini 4 Neon)