Skip to content

zink: disable implicit_sync on Borealis and Honeykrisp - #618

Merged
DjDeveloperr merged 4 commits into
aurora-wipfrom
djdev/zink-borealis-robustness
Dec 2, 2026
Merged

DjDeveloperr merged 4 commits into
aurora-wipfrom
djdev/zink-borealis-robustness

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 21, 2026 •

Copy link
Copy Markdown

What: Zink applies its implicit-sync workaround to every Vulkan driver it doesn't list as syncing WSI explicitly. On Wayland that adds an empty queue submission and a fence wait inside eglSwapBuffers. Borealis and Honeykrisp sync WSI explicitly, so this adds both driver IDs to the explicit-sync list in init_driver_workarounds() (zink_screen.c). The per-pipeline robustness half of the original series is already on aurora-wip through #899 and #905.
Tested: The "commit 1 only" arm in the earlier description below is exactly this diff: Minecraft 26.3 over Zink on J773g went from 32.8 to 44.8-45.5 FPS, with 0 GPU faults. That was on an older base. Merge-result CI on current aurora-wip passed: https://github.com/DjDeveloperr/mesa/tree/ci/head-618-0f80eed3.
Risk: two-way door · GL through Zink on Borealis and Honeykrisp, on every Mac. Native GL and Vulkan applications are unaffected.
Not yet: rows at this head on J773g and J700: Zink Wayland present and synchronization, base against head.

Earlier description (three-commit series)

Problem

Running OpenGL applications over Zink on Borealis incurs two avoidable bottlenecks on Wayland and on indirect indexed draws:

  1. Synchronous present stalls in Zink Kopper: init_driver_workarounds() does not list VK_DRIVER_ID_AURORA_BOREALIS (or VK_DRIVER_ID_MESA_HONEYKRISP) among the drivers with explicit WSI synchronization, leaving implicit_sync = true. On Wayland, kopper_present() submits an extra empty queue submission and blocks in vkWaitForFences() on the render thread inside eglSwapBuffers.
  2. Global device-wide buffer robustness forcing robust indirect index repair on non-robust GL contexts: When VK_EXT_robustness2 is available, Zink enables robustBufferAccess and robustBufferAccess2 globally on VkDevice even for non-robust OpenGL contexts. On Borealis, hk_needs_index_robustness() and the vertex input lowering paths previously checked device-level enabled_features.{robustBufferAccess,robustBufferAccess2,pipelineRobustness}, forcing per-draw compute index-buffer repair (libagx_draw_robust_index_batch), CDM-to-VDM barriers, per-sub-draw draw-state pool uploads, and D3D vertex bounds checks on every indirect indexed draw.

Change

Three commits cleanly targeting aurora-wip (fa9a6766c01), gated purely on driver identity / Vulkan extension capabilities (no chip, board, or firmware gates; works with default configuration):

  1. zink: disable implicit_sync workaround on Honeykrisp and Borealis (src/gallium/drivers/zink/zink_screen.c)
    • Adds VK_DRIVER_ID_AURORA_BOREALIS and VK_DRIVER_ID_MESA_HONEYKRISP to the explicit-sync driver list in init_driver_workarounds(), matching other open-source Mesa Vulkan drivers.
  2. zink: use VK_EXT_pipeline_robustness for per-context buffer robustness (src/gallium/drivers/zink/{zink_device_info.py,zink_pipeline.c,zink_program.{c,h},zink_screen.c,zink_types.h})
    • When VK_EXT_pipeline_robustness is supported alongside robustBufferAccess, defers buffer robustness from device-wide robustBufferAccess / robustBufferAccess2 to per-pipeline VkPipelineRobustnessCreateInfoEXT while preserving nullDescriptor and image robustness at the device level.
    • Non-robust GL contexts request VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT per pipeline; PIPE_CONTEXT_ROBUST_BUFFER_ACCESS contexts request VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT on graphics and compute pipelines.
  3. borealis: honor per-pipeline vertex input robustness across GPL and reuse robust-index draw state (src/vulkan/runtime/{vk_graphics_state.{c,h},vk_shader.c}, src/asahi/vulkan/{hk_cmd_draw.c,hk_shader.{c,h}})
    • Propagates resolved VkPipelineRobustnessCreateInfoEXT::vertexInputs through vk_graphics_pipeline_state (on VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, merged and copied across GPL libraries) and vk_dynamic_graphics_state (dirtying MESA_VK_DYNAMIC_VI on change and clearing on vkCmdBindShadersEXT()).
    • Includes state->vi_robustness in hk_vs_key for static-VI and LTO-linked GPL compiles, queries the effective command/pipeline vertex input robustness in hk_fill_fast_link_key_vs(), hk_flush_dynamic_state_slow(), and hk_needs_index_robustness(), and reuses hk_g17p_draw_state_offset() in hk_emit_robust_index().

Testing

Tested on Apple M4 Mac mini (Apple M4 (G16G B0)), Arch Linux ARM, kernel 7.3.0-ARCH-m4drv8, headless Wayland (kwin_wayland --virtual --width 1920 --height 1080), Minecraft 26.3 (RD 12, Fancy, VSync off, maxFps 260, fixed 50s still:15,spin:15,fly:20 benchmark scene). All timed rows satisfied thermal and load gates (hotspot <= 70 C, load1 < 0.5), with 0 GPU kernel error/fault lines and 0 failed units.

Same-Machine A/B Performance (Zink on Borealis vs Native Vulkan)

Arm Path Mesa revision Still FPS Spin FPS Fly FPS All FPS p50 / p99 (ms) Render CPU (user) ms/frame (still) Proc CPU ms/frame (still)
Baseline Zink on Borealis d4ad4a4dce 30.7 30.9 35.9 32.8 30.13 / 43.76 7.71 (7.60) 29.46
Commit 1 only Zink on Borealis e222fe5e62 41.5–42.3 42.4–42.9 49.2–49.8 44.8–45.5 (+36.6–38.7%) 22.17–22.55 / 30.62–31.40 7.14–7.35 25.35–25.69
Proposed (Commits 1–3, pre-GPL fix) Zink on Borealis ed1ffa40c4 97.0 82.7 113.5 99.3 (+202.7% / 3.03x) 9.64 / 17.93 5.19 (5.05) (-32.7%) 9.96 (-66.2%)
Proposed (Commits 1–3, with GPL fix) Zink on Borealis e1ba7c727a (branch head 140d767cba6) 96.7 84.0 116.1 100.7 (+207.0% / 3.07x vs baseline) 9.43 / 18.09 5.29 (5.17) (-31.4%) 10.10 (-65.7%)
Reference (same stack) Native Vulkan (Borealis) ed1ffa40c4 95.5 83.3 113.5 99.0 (Zink = 100.3–101.7% parity) 9.63 / 17.45 5.13 (4.25) 8.93
  • JFR render-thread verification: SDL_GL_SwapWindow (eglSwapBuffers) dropped from 77.4% (~22.3 ms/frame) at baseline to 30.7% (~6.8 ms/frame) after Commit 1 and 8.5% (~0.85 ms/frame) after Commits 2–3. Process CPU per frame dropped -65.7% to -66.2% (29.46 -> 9.96–10.10 ms/frame in still), matching native Vulkan (8.93 ms/frame).

Conformance Gates (VK-GL-CTS 1.4.7.1, 0 GPU faults)

Suite Driver / Path Result
vk-robust (2,845 cases: vk-vertex-index-robustness, vk-pipeline-robustness incl. vert_{fast,optimized}_gpl, vk-robustness2-vi) Borealis (e1ba7c727a) 1,184 Pass / 1,661 NotSupported / 0 Fail / 0 Crash / 0 Timeout — all 8 GPL vertex_attribute_fetch cases 8 / 8 Pass
gles31-mdi-gate + gl46-mdi-gate (458 cases) Gallium Asahi OpenGL (e1ba7c727a) 439 Pass / 19 NotSupported / 0 Fail / 0 Crash / 0 Timeout
gles31-mdi-gate + gl46-mdi-gate Zink on Borealis (ed1ffa40c4) 457 / 457 Pass (0 Fail / 0 Crash / 0 Timeout)
KHR-NoContext robustness Zink on Borealis (5411b98d71) 4 / 4 Pass
Driver identities, benchmark settings, and build options
  • Build configuration: Release (-Dbuildtype=release -Db_ndebug=true), gallium-drivers=asahi,zink, vulkan-drivers=asahi, llvm=disabled, spirv-tools=disabled, glvnd=enabled, clang 23.1.5 (aarch64).
  • Candidate binaries (e1ba7c727ae449f818510dad36476177f115bf38):
    • libvulkan_asahi.so SHA256: 106a6c75259013de75767acd448914bbd6ceb4ec502803657ee692b50228a552
    • libgallium-26.3.0-devel.so SHA256: 49128984b68ef82971dede735ecf67c8a19ad5d0715529f800dddc8010991917
  • Workload: Vanilla Minecraft 26.3 offline client (Temurin 25.0.5, -Xms1G -Xmx2560M -XX:+UseZGC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication), renderDistance:12, graphicsPreset:"fancy", enableVsync:false, maxFps:260, 1920x1080 fullscreen on headless KWin Wayland, MESA_LOADER_DRIVER_OVERRIDE=zink for Zink rows.
  • No regressions: Native Vulkan throughput (99.0 FPS vs 99.7 FPS baseline, within ~0.7% run-to-run variance) and conformance are preserved; robust GL contexts continue to enforce ROBUST_BUFFER_ACCESS_EXT per pipeline.

Still to run

  • Cross-generation A/B and CTS regression verification on G13 / G14 (M1/M2), G17P (M4 Pro / A18 Pro), and M5 (Borealis + Zink) to confirm parity across every supported GPU generation before marking ready for merge.

Not yet

  • M4 mini J773g: verify the GL robustness path on the fixed revision. Neo J700: check the shared Zink-on-Borealis path and Minecraft stability.

Both VK_DRIVER_ID_MESA_HONEYKRISP and VK_DRIVER_ID_AURORA_BOREALIS are
open-source Mesa drivers with explicit WSI synchronization, matching the
other Mesa drivers listed in init_driver_workarounds(). Leaving
implicit_sync enabled causes kopper_present() on Wayland to submit an
extra empty queue submission and block synchronously in vkWaitForFences()
on the render thread inside eglSwapBuffers.

Signed-off-by: Diljit Singh <hey@djdev.me>
When VK_EXT_pipeline_robustness is supported alongside robustBufferAccess,
defer buffer robustness from device-wide robustBufferAccess/robustBufferAccess2
to per-pipeline VkPipelineRobustnessCreateInfoEXT while keeping nullDescriptor
and image robustness intact at the device level.

Non-robust OpenGL contexts then request DISABLED buffer robustness per pipeline
instead of triggering device-wide indirect index repair and vertex/buffer bounds
checks on drivers such as Borealis, while PIPE_CONTEXT_ROBUST_BUFFER_ACCESS
contexts request ROBUST_BUFFER_ACCESS_EXT on monolithic graphics and compute
pipelines.

Signed-off-by: Diljit Singh <hey@djdev.me>
…euse robust-index draw state

Propagate resolved VK_EXT_pipeline_robustness vertexInputs behavior through vk_graphics_pipeline_state (on VERTEX_INPUT_INTERFACE_BIT_EXT, merged and copied across graphics pipeline libraries) and vk_dynamic_graphics_state (dirtying MESA_VK_DYNAMIC_VI on change and clearing on vkCmdBindShadersEXT).

In Borealis, include state->vi_robustness in hk_vs_key for static-VI and LTO-linked GPL vertex shader compiles, and query hk_cmd_vertex_input_robustness() in hk_fill_fast_link_key_vs(), hk_flush_dynamic_state_slow(), and hk_needs_index_robustness() so monolithic pipelines, fast-link GPL, and optimized-link GPL all honor per-pipeline vertex input robustness instead of forcing robust index repair and D3D vertex bounds checking whenever pipelineRobustness is enabled on the device.

Also reuse hk_g17p_draw_state_offset() in hk_emit_robust_index() so robust indirect draws share the cached draw-state selector upload instead of allocating a fresh 8-byte VDM pool entry per sub-draw.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Author

Rebased cleanly onto current aurora-wip (8e288e5dbc3, picking up #588/#594/#628) at 4588160866d (resolved minor chip-predicate conflict in src/asahi/vulkan/hk_cmd_draw.c).

Verified full native build + meson test --suite asahi: 176/176 passed, 0 failed.

Assisted-by: LLM (Gemini:4 Neon)

@DjDeveloperr
DjDeveloperr force-pushed the djdev/zink-borealis-robustness branch from 140d767 to 4588160 Compare November 21, 2026 23:33
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 30, 2026 20:46
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 30, 2026 20:46

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES at 45881608

Blockers:

  1. Branch is CONFLICTING with aurora-wip. Rebase/merge current aurora-wip across the 12 touched files (+217/-52) so the PR is MERGEABLE.
  2. Missing exact-head build/host test and dual GPU-generation hardware verification. After rebasing, post Asahi host test results and hardware verification covering both Zink and Borealis changes.

Checked:

  • Metadata and diff summary (+217/-52, 12 files), CONFLICTING against aurora-wip.
Evidence
  • Resolve CONFLICTING against aurora-wip before code/hardware sign-off.

Keep the per-context and per-pipeline robustness implementations already merged in #899 and #905, including descriptor-size checks and robust-index draw-state reuse. The remaining change selects explicit synchronization for the two driver IDs.

Signed-off-by: DjDeveloperr <hey@djdev.me>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at b4e585c8066e

Blockers:

  • Update the PR title and description to match the narrowed +2/-0 scope at b4e585c8066e (the per-pipeline GPL vertex-input-robustness work has already landed on aurora-wip; this branch now only disables implicit_sync in src/gallium/drivers/zink/zink_screen.c).
  • Post exact-head b4e585c8066e build/unit-test results and Wayland Zink swapchain/presentation verification on two GPU generations confirming disabling implicit_sync works without visual corruption, hangs, or frame-pacing regressions.

Checked:

  • Audited the full +2/-0 diff in src/gallium/drivers/zink/zink_screen.c (init_driver_workarounds()): adds both Borealis Vulkan driver IDs to the screen->driver_workarounds.implicit_sync = false switch arm alongside VK_DRIVER_ID_MESA_NVK and VK_DRIVER_ID_MESA_KOSMICKRISP.
  • Confirmed MERGEABLE against aurora-wip with no remaining Borealis shader/GPL changes in the diff.
Evidence
  • Head: b4e585c8066e772591dbfd22ae3156418d0373be (base aurora-wip, MERGEABLE).
  • Diff stat: src/gallium/drivers/zink/zink_screen.c | 2 ++.
  • Note: zink_screen.c matches both the legacy and current Borealis driver ID constants cleanly; no other files are modified.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 1, 2026
@DjDeveloperr

Copy link
Copy Markdown
Author

Merged aurora-wip at b4e585c8066e. #899 and #905 already provide the per-context/per-pipeline robustness and robust-index state reuse. The remaining diff is two driver IDs in Zink’s explicit-sync list. Please compare Wayland present and synchronization on J773g and J700.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at b4e585c8066e

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Audited the full +2/-0 diff in src/gallium/drivers/zink/zink_screen.c (init_driver_workarounds()): adds both Borealis Vulkan driver IDs to the screen->driver_workarounds.implicit_sync = false switch arm alongside VK_DRIVER_ID_MESA_NVK and VK_DRIVER_ID_MESA_KOSMICKRISP.

  • Confirmed MERGEABLE against aurora-wip with no remaining Borealis shader/GPL changes in the diff.

Follow-ups (not blocking): update title/body to +2/-0 implicit_sync scope; head build + Wayland Zink row (one GPU gen enough)

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at b4e585c8: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA b4e585c8, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr

Copy link
Copy Markdown
Author

J700 (G17P) row at head b4e585c8066e: 0 status changes; one throughput drop to look at.

mesa#618 · J700 MacBook Neo (A18 Pro, G17P B1), stock Fedora 44 7.3.0-41.fc44.aurora.aarch64, same boot, base 8b59f2b vs head b4e585c: INCOMPLETE (618-egl incomplete (3 NotRun at head)) — Wayland present on a private headless weston (Zink, 256×256 window): interval-0 1273 → 1197 fps (-6.0%), interval-1 swap median 15250 → 15216 µs, every pre-swap readback matched; glmark2-es2-wayland via Zink score 3230 → 7677 (+137.7%), validation base 27 Success / 6 Unknown / head 27 Success / 6 Unknown; 618-gles3 865/865 compared, base 860 Pass / 5 NotSupported → head 860 Pass / 5 NotSupported, 0 status changes; 618-gles31 571/571 compared, base 569 Pass / 1 NotSupported / 1 Fail → head 569 Pass / 1 NotSupported / 1 Fail, 0 status changes; 618-egl 115/118 compared, base 89 Pass / 21 NotSupported / 4 Fail / 3 NotRun / 1 Timeout → head 89 Pass / 21 NotSupported / 4 Fail / 3 NotRun / 1 Timeout, 0 status changes; 0 GPU faults, 0 kernel WARNINGs; stock handback verified.

About "INCOMPLETE": 3 EGL cases recorded NotRun in both arms (same list at base), and every compared case matches. Under Zink on a private headless weston, glmark2 rose +137.7 % and interval-1 swap timing is flat, but interval-0 present throughput fell 6.0 % (1273 → 1197 fps, 256×256). That is worth a look before merge: implicit sync off may change how often frames are presented when nothing waits for vblank.

Kit B payload 5c0239c4471e71ad…, target evidence 91796765eaa899d7… (Mini: work/j700-mesa-batch-b-20261202/evidence/receipt-WfPHHaNB). The run started about 08:44 UTC and spent 347 s on target under the Neo lease. The stock fingerprint and both Apple partners were identical before and after.

@DjDeveloperr

Copy link
Copy Markdown
Author

Row: b4e585c8066e + J773g (Apple M4 Mac mini, T8132, G16G B0 / HAL200 / AGX3B, kernel 7.3.0-ARCH-m4main-6c83a2a6, boot_id=21564087-69fe-448d-be51-ec60300e9bc4) + PASS: same-boot Zink on Borealis Wayland A/B vs base 8b59f2b0a70e, +2.65x–+2.82x Wayland glmark2 throughput (eglSwapBuffers frame time 0.32–0.37 ms -> 0.11–0.14 ms), 586 Zink GLES3 CTS + 41/41 VK sync CTS with 0 diffs, 0 GPU faults.

  • Wayland present/swap (MESA_LOADER_DRIVER_OVERRIDE=zink, glmark2-wayland / glmark2-es2-wayland / vkcube, 800x600 windowed):
    • glmark2-wayland (Zink GL 4.6): base git-8b59f2b0a7 score 2534 (build 3117 fps / 0.321 ms, texture 2963 fps / 0.338 ms, shading 2706 fps / 0.370 ms, buffer 1357 fps / 0.737 ms) → head git-b4e585c806 score 6723 (2.65x, build 8603 fps / 0.116 ms, texture 8886 fps / 0.113 ms, shading 7206 fps / 0.139 ms, buffer 2204 fps / 0.454 ms).
    • glmark2-es2-wayland (Zink GLES 3.2): base 2752 (build 2858 fps, shading 2649 fps) → head 7772 (2.82x, build 8456 fps, shading 7091 fps).
    • vkcube --c 120 (Wayland WSI): clean on both base and head.
  • CTS A/B (MESA_SHADER_CACHE_DISABLE=true):
    • Zink GLES3 (dEQP-GLES3.functional.{fence_sync,fbo.completeness}.*, surfaceless FBO 256x256): 586 cases (585 Pass, 1 QualityWarning) on both base and head (0 diffs).
    • Borealis Vulkan (dEQP-VK.synchronization.{smoke,basic}.*): 41/41 Pass on both base and head (0 diffs).
  • GPU health: health: failed 0 errno 0 degraded 0, recoveries 0, hang_kills 0, 0 dmesg faults.

@DjDeveloperr DjDeveloperr changed the title zink, borealis: disable implicit_sync and honor per-pipeline vertex input robustness across GPL zink: disable implicit_sync on Borealis and Honeykrisp Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Author

Local check on the merge tree (pc, x86-64 clang, asserts on, -Dgallium-drivers=asahi,zink, Borealis + drm-shim, every test input rebuilt and a second ninja pass clean): aurora-wip 893e648e + #1546 + #1541 + #619 + #659 + #636 + this head b4e585c8 → tree 28f09264. Zink built, and meson test --suite asahi --suite poly --suite vulkan gave 463 OK, 0 fail, 1 skip (hk-g17p-cross-queue, needs two queues).

Rows at this head: J773g Wayland glmark2 2.65× (GL) and 2.82× (GLES) with 586 Zink GLES3 and 41 Vulkan sync cases unchanged; J700 glmark2-es2-wayland +138 % with no CTS status changes and 0 GPU faults on either Mac. The one regression is J700 interval-0 present throughput at 256×256 on a headless weston, 1273 → 1197 fps (−6 %), with interval-1 swap timing flat. That doesn't outweigh the gains or break anything, so I'm merging and leaving it as a follow-up for the uncapped present path.

I retitled it to match the two-line diff; the robustness half of the old series is already on aurora-wip.

@DjDeveloperr
DjDeveloperr merged commit 2d79a5a into aurora-wip Dec 2, 2026
1 check passed
@DjDeveloperr
DjDeveloperr deleted the djdev/zink-borealis-robustness branch December 2, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant