Repository navigation
Conversation
Upstream cherry-pick f043b2c (Mike Blumenkrantz, mesa-stable) as c09d7ab, authorship kept. zink_set_last_vertex_key only set last_vertex_stage_dirty, which does not make the next draw update the program; when the threaded context merged separate glDrawElements into a multi-draw, a push_drawid flip left the DrawIndex-reading VS bound and gl_DrawID read hk's incrementing draw index (tests/drawid single mode). Evidence: mini PASS (tests/drawid single and multi); host lavapipe single and multi pass.
hk: pass the draw's indices to the restart-aware IA counter (c2a5be3), correcting ba4f4d2. For direct draws agx_draw_index_range_el is relative to the first index, so the counter needs agx_draw_index_buffer(draw) with first index 0 in the descriptor; ba4f4d2 paired the binding base with that reduced range, so loads past it read element 0 and the restart marker was counted. Evidence: Air PASS (native vkstats, firstIndex 8: candidate 3/3, base 0/3) and mini PASS.
hk_occlusion_prepare_draw ends a control stream whose occlusion segment slots are exhausted and starts a new one. It ran after hk_apple9_prepare_draw had committed the draw's render state to the old stream: the new stream lacked the depth bias representation (asserted in hk_apple9_draw_impl; in release builds D16 and forced-UNORM bias were then emitted as float bias), the sample positions, and the write/pre-raster read classes. dEQP-GLES3.stress.occlusion_query.* hit it on the host shim. Do that split at the start of hk_apple9_prepare_draw, so the state lands on the stream the draw records into; the later segment selection then always has a free slot. Generated-by: LLM
GL lets a vertex buffer be bound at or past the end of its buffer (every fetch is then out of bounds); Vulkan requires vkCmdBindVertexBuffers offsets to be less than the buffer size. Zink passed the GL offset through, which hit vk_buffer_range's offset <= size assertion on hk in dEQP-GLES31.stress.vertex_attribute_binding.buffer_bounds.* (host shim, assertion build). Bind VK_NULL_HANDLE for such bindings, as for bindings without a buffer; Zink requires nullDescriptor, so their fetches read zero. Generated-by: LLM
hk: reuse Apple9 sysvals when dirty inputs are unchanged (6126f01). Pipeline binds and state restoration dirtied blend constants and color write enables without changing them, so the 3,712-byte graphics sysval block was uploaded again. The block is a device-constant base plus exactly the keyed inputs, so the two dirty-bit tests become exact value comparisons (bitwise floats, the 32-bit enable mask); a hit consumes the dirty bits where the rebuild always did, and failure keeps the old key. Evidence (PASS_AVAILABLE_WORKLOADS): 12/12 probes at 1/2/4x MSAA, 2,304 pixels; Factorio dynamic state 64 -> 32 B/draw, CPU -0.95% median (STK and Luanti skipped: no traces). Host: strict identity 7,008 + 11 entries, 316/316 diagnostic captures identical.
asahi: retire BOs on a device reaper outside submit threads (7a6cb02), avoid redundant reaper wakes and detach inherited devices after fork (9ae458b), and reject inherited cache entries in a forked child (0dc196d). Final BO releases cache or enqueue; a per-device agx-bo-reaper thread does munmap, PRIME fd close, GEM_CLOSE and VA free outside bo_map_lock and the cache lock, so GEM_CLOSE's whole-VM wait no longer runs on GL, threaded-context or submit threads. Import can resurrect a queued shared BO, a same-handle import waits only for that close, VA is freed only after a successful close, and teardown joins before freeing the handle map, heaps and fd. Wakes are signalled only on empty-to-nonempty transitions. In a forked child (pthread_atfork, all device locks held across fork) releases only discard: no GEM_CLOSE, VA free, wait, join or cache reuse on the shared drm_file. Conflict: src/asahi/lib/meson.build, where both this series and the draw-tables merge added a test; both tests are kept. Evidence: application-thread GEM_CLOSE 0 in every workload (asahi STK 1,057 -> 0, Luanti 584 -> 0, Zink STK 331 -> 0), all on the reaper; 4/4 probes pass. Host: 60/60 release and assertion suites; reaper unit including a real fork with the worker blocked in a mocked GEM_CLOSE.
A GEM close while the VM has work queued only marks the old mappings closing: the kernel removes them once the work queued at the close has completed, since it cannot tell which of that work used the object. A bind over a closing range waits for all of it. The heaps allocate top-down, so the VA the reaper has just freed is the next one handed out, and an ordinary allocation (a texture upload) then waits for the whole backlog: 7-23 s per stall in the churn attribution test on the mini (4 processes, 128 queued Works each). Retired VAs now wait in a FIFO and return to their heap once a per-heap byte cap (heap / 8, at most 8 GiB) is exceeded. An allocation that would fail first returns the quarantine and retries once: for a fixed address only the overlapping entries, otherwise the heap's. A forked child never flushes. The capture-replay heaps keep a cap of 0. Explicit unbinds (agx_va_free with unbind) are unchanged: the kernel already waited. Generated-by: LLM
Retired VAs, the largest total quarantined, and releases by cap, by allocation failure and by fixed-address conflict. AGX_VA_QUARANTINE_STATS prints them at device teardown, so an A/B can show which path fired. Generated-by: LLM
…-cap heaps Review: the counters relied on a zero-allocated device. The replay heaps' cap of 0 is no quarantine, so their retires are not counted as cap releases. Generated-by: LLM
Recompute push reads at the final Honeykrisp NIR handoff in assertion builds. Restore root identity from the Apple9 UBO lowering on an analysis clone, preserve loaded-pointer boundaries, and reject any read absent from the owning API shader mask. Exercise lowered direct and indirect reads, dynamic offsets, descriptor pointers and unrelated address phis. The 7,008-shader corpus plus 11 state entries and internal/meta recording coverage report zero subset violations.
… size push descriptors hk: limit Apple9 root uploads to live push-constant ranges (a90d395), reuse identical attachment metadata across renders (64e07ab), size push-descriptor uploads from their layout (266aa17), and assert final Apple9 push readers fit the upload mask (ed7451f). - Each API shader records which push-constant words it reads (constant push loads and root-relative global loads; anything unmodelled reads all). Roots reuse the last upload when the newly read words are a subset of the last upload's and equal, copy only read words, and end at the push region when no root constants or dynamic buffers exist. Container version 0x484b0005. - Per-render attachment metadata is reused when per-RT dimensions and sample counts are equal; clear parameters use the content-compared upload-last slot. - Push descriptor sets upload their layout extent instead of 8 KiB. - Debug builds recompute the push-read mask on the final lowered NIR (root loads restored on a clone) and assert it is within the recorded mask: 0 hits over 7,008 corpus shaders plus internal and meta, 24,325 checks. Evidence (PASS on available workloads): 12,288 VK + 2,304 GL pixel checks; Factorio CPU -1.04%, descriptor tables 140 -> 73 B/draw, root 753 -> 497 B/draw. Host: strict identity 7,008 + 11 unchanged, 316/316 captures identical.
… state hk: split for occlusion segments before preparing Apple9 render state (ff4b0da). A stream split for exhausted occlusion segments ran after hk_apple9_prepare_draw had committed the depth-bias representation, sample positions and read/write classes to the old stream; it now runs first, with the same condition and END_QUERY hint. Evidence: dEQP-GLES3.stress.occlusion_query cases crash (dbias_is_int assert) on base, pass on candidate; regress 95 + 2 crashes -> 97/97; 0 regressions.
… end zink: bind no vertex buffer for offsets at or past the buffer's end (54e30c7). GL allows vertex binding offsets at or past the buffer size; Vulkan requires them inside it. Such bindings now bind VK_NULL_HANDLE (nullDescriptor: fetches read zero). Evidence: dEQP-GLES31.stress.vertex_attribute_binding.buffer_bounds.* crash (vk_buffer_range assert) on base, pass on candidate; 0 regressions.
…t once asahi: quarantine VAs of closed BOs instead of recycling them at once (bf68435), count VA quarantine releases by cause (aa4bdc7) and the counter init/zero-cap fix (caef29d). The BO reaper returned a closed BO's VA to its heap right after GEM_CLOSE; the heaps allocate top-down, so it was the next VA handed out, and a VM_BIND over the still-closing range waited for the whole VM's backlog (7-23 s churn stalls). Retired VAs now wait in a FIFO with a per-heap byte cap (min(size/8, 8 GiB); replay heaps 0), returning early only when an allocation would fail: all of the heap, or for a fixed address only the overlapping entries. Never in a forked child. Early release at worst restores the old stall, never a stale mapping. AGX_VA_QUARANTINE_STATS prints retired/high-water/release-cause counts at teardown. Evidence: same-boot A/B (post-hoc re-score; rule pre-registered for future runs; v5's count rule FAILed 33 > 32 only through extra OWN_BACKLOG submit-throttle waits): PASS. VM_BIND stalls 5 -> 0, total stalled time 102.8 -> 51.4 s, worst stall 23.8 -> 3.3 s, iterations P1/P2/P4 741/872/1069 -> 741/873/1129; all v5 correctness checks hold, 0 candidate hard/hung cells by structure and string.
hk: preserve shader memory effects across binary reloads (22247a1). On a non-deferred binary cache hit, hk_deserialize_api_shader_inner rebuilt writes_memory as "any non-fragment stage, or a backend fragment writer", so a read-only vertex shader became an application memory writer and its render lost tiling overlap with fragment work. Freshly compiled shaders already take writes_memory from the API NIR (graphics path and deferred path). The value is now serialized and restored as is, matching the fresh model; container version 0x484b0006 (pipeline and shader-binary UUIDs already reject old blobs by build hash). Release and assert Asahi suites 63/63; the new hk-variant-cache case (read-only VS stays read-only and an FS with a real store stays a writer after reload) fails on the old deserializer. Shader binaries/ASM identical over the full STK (141 unique) and Luanti (69 unique) traces; 24 cold/warm Vulkan command/upload cases exact. On the traces, fragment-only dependency renders rise 3,443 -> 21,765 (STK) and 28,000 -> 46,995 (Luanti) with render, draw and merge records unchanged. GPU timing is a separate test.
A suspended dynamic render must preserve its colour attachments for a later resumed instance even when its final storeOp discards them. Emit the partial colour end-of-tile program when the suspended render cannot stay open. Keep the original first-stream ZLS clear/load state: zls_last already preserves suspended stores, while partial ZLS would lose a stencil clear. This applies independently of feedback compression. The focused dynamic-rendering suspend/resume list matches stock (20 pass, 72 skip), including ten stencil cases that caught the incorrect partial-ZLS version.
Rebase the reviewed recording-local feedback decompression model onto 201a583. Retain unsupported-format, depth, multisample and 3D bans; integer alias blits preserve storage bits. The independent suspended-render EOT fix is a separate parent commit. Review follow-ups and renewed validation follow in this topic branch.
Prepare feedback before classic and mesh draws, including hybrid native mesh. Reject later BeginRendering/draw/end work after a failed decompression instead of inspecting uninitialized rendering state. Assert that integer self-blit render tiles cover complete compression blocks and metadata fills cover integral uint4 records. Add a host recording test that injects a decompression allocation failure and exercises later classic/mesh draw and end entry points; extend format geometry checks across texel sizes.
Track calls, logical texel bytes, hits and misses per command recording, then accumulate them per actual submission in HK_CPU_TIMING. Differences of HK_FEEDBACK reports give counts per presented frame, including resubmitted command buffers. Label GPU_PASS groups for meta, decompression blits and feedback renders. No GPU program or command change is intended; all reporting remains opt-in.
Shader bodies no longer get a BO each. 3f7dcdf separates body ownership from BO storage, 9d3cd81 packs immutable Apple9 bodies into shared, reclaimable slabs, and 68145f3 reserves a mapped tail after each body so instruction prefetch past the end of a body stays inside mapped memory. Mini r2 PASS (35 + 14 ER processes, baseline ed7451f): - body readback probes (4,352 bodies), Vulkan, native GL and Zink at 1x/2x/4x MSAA pass in both arms; the edge probe ran a 576-byte body with a 1 KiB mapped tail and 256 same-address replacements; - ER screenshots byte-identical between arms; - GEM: body probe -63 MiB, ER -17 MiB median, Luanti +33 MiB (+6.6%, one replay); STK and Luanti CPU timing within noise.
On G16 the kernel-private heap sits at the top of the 4-GiB compact render context, and PPP/VDM records get what's left above the low 64 MiB of fixed aliases. Mesa only rejected kernel heaps below 64 MiB, so a kernel advertising nearly 4 GiB would have wrapped the context heap's size. Fail VM setup cleanly unless at least 1 GiB remains for records. The TVB v3 kernel (vm_kernel_min_size 1152 MiB) leaves 2,880 MiB. AGX_VA_QUARANTINE_STATS now also prints the context heap's high water (live plus quarantined VA) against its size, so record use can be measured instead of estimated. Heap use is tracked for every heap under vma_lock. Generated-by: LLM
…p use bdeaeb9: VM setup fails cleanly on G16 unless the compact render context keeps at least 1 GiB for PPP/VDM records after the kernel heap (TVB v3 advertises 1152 MiB, leaving 2,880 MiB), and AGX_VA_QUARANTINE_STATS reports the context heap's high water. Host-only; merge-gate --no-codegen-change.
agx_set_framebuffer_state copied the new state into ctx->framebuffer and then decompressed attachments whose view format is incompatible with their compressed layout. On Apple9 the decompression copy runs through u_blitter, which saves and restores the current framebuffer: restoring re-entered agx_set_framebuffer_state with the still-compressed resource and decompressed it again, recursively, allocating a new copy each time. An RG16F view of a compressed R32F texture as a render target charged ~2.1 GB to its 2 GiB cgroup on T8132 and was OOM-killed (sparsert, view-sparse). Legalize the incoming attachments first; a nested blit then restores the previous, already legal framebuffer. Host (G16 noop shim): view-sparse/view-dense now decompress once and peak at 35 MB instead of exhausting memory. Generated-by: LLM
36a9b3f to
4831e52
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Zink restart splitting mishandles draw IDs and client-memory indices, while Asahi can fail configuration without glslang and advertises sample counts and features its native paths reject.
5 open issues
Require glslang for Asahi Vulkan configuration · New Preserve draw ID semantics across primitive-restart splits · New Upload client-memory indices for every split segment · New Restrict advertised sample counts to the native tile budget · New Clear Apple9 feature bits for unsupported capabilities · New
What changed in this PR
This PR brings native Apple9/M4 Vulkan graphics and compute support into Honeykrisp for Zink desktop workloads, alongside shared compiler, resource-management and rendering fixes. It builds on the common Zink fixes described in PR #2.
Changes:
- Integrates native rendering, timestamps, multisampling, resolves, transfers and bounded diagnostics.
- Adds shared launch helpers, software FP64 support and cooperative-matrix lowering.
- Expands regression coverage for descriptors, shader compilation, tile layouts and memory allocation.
| File | Description |
|---|---|
src/vulkan/runtime/vk_meta_private.h |
Exposes the internal blit shader builder for tests. |
src/vulkan/runtime/vk_meta_blit_resolve.c |
Shares the production blit shader builder. |
src/gallium/drivers/zink/zink_types.h |
Tracks failed graphics-pipeline lookup. |
src/gallium/drivers/zink/zink_screen.c |
Adjusts Honeykrisp rendering workarounds. |
src/gallium/drivers/zink/zink_program_state.hpp |
Corrects topology caching and failed-pipeline handling. |
src/gallium/drivers/zink/zink_draw.cpp |
Handles pipeline failures, topology changes and restart splitting. |
src/gallium/drivers/zink/zink_clear.c |
Corrects pending-clear overlap decisions. |
src/gallium/drivers/asahi/test/test-apple9-launch.cpp |
Tests allocation sizes and launch encodings. |
src/gallium/drivers/asahi/test/test-apple9-geometry.cpp |
Uses the shared geometry interface. |
src/gallium/drivers/asahi/README.apple9-launchers.md |
Documents supported threadgroup allocations. |
src/gallium/drivers/asahi/meson.build |
Builds tests with relocated shared helpers. |
src/gallium/drivers/asahi/agx_pipe.c |
Uses writeback caching for scanout buffers. |
src/gallium/drivers/asahi/agx_apple9.h |
Replaces local declarations with shared interfaces. |
src/compiler/spirv/vtn_cmat.c |
Validates native matrix memory-access restrictions. |
src/compiler/spirv/spirv_to_nir.c |
Initializes diagnostic options before header validation. |
src/compiler/spirv/nir_spirv.h |
Adds a matrix memory-access restriction option. |
src/compiler/glsl/float64.glsl |
Fixes rounding and adds software FMA/division. |
src/asahi/vulkan/test/test-hk-apple9-spirv-scan.cpp |
Tests matrix imports and malformed modules. |
src/asahi/vulkan/test/test-hk-apple9-msaa.cpp |
Tests multisampling, resolves and packed-float attachments. |
src/asahi/vulkan/meson.build |
Registers native modules, FP64 generation and tests. |
src/asahi/vulkan/hk_shader.h |
Adds native shader metadata and mapping interfaces. |
src/asahi/vulkan/hk_queue.c |
Submits native render jobs and attachment records. |
src/asahi/vulkan/hk_query_pool.c |
Restricts native query pools to timestamps. |
src/asahi/vulkan/hk_physical_device.c |
Adjusts native capabilities and device limits. |
src/asahi/vulkan/hk_nir_lower_descriptors.c |
Adds buffer-only descriptor lowering. |
src/asahi/vulkan/hk_meta_upload.h |
Defines raw transfer shaders and addressing helpers. |
src/asahi/vulkan/hk_image.c |
Adjusts storage features, compression and linear-image admission. |
src/asahi/vulkan/hk_device.h |
Stores the device-owned FP64 library cache. |
src/asahi/vulkan/hk_device.c |
Initializes native entries, experiments and FP64 state. |
src/asahi/vulkan/hk_device_memory.c |
Reuses synchronized read-only buffer mappings. |
src/asahi/vulkan/hk_cmd_draw.c |
Routes native rendering and draws. |
src/asahi/vulkan/hk_cmd_clear.c |
Adds image-clear diagnostics. |
src/asahi/vulkan/hk_cmd_buffer.h |
Adds native pools, render state and dispatch hooks. |
src/asahi/vulkan/hk_cmd_buffer.c |
Manages native command-buffer resources and initialization. |
src/asahi/vulkan/hk_buffer_view.c |
Filters native storage-texel format support. |
src/asahi/vulkan/hk_apple9.h |
Defines native descriptor mappings and resource interfaces. |
src/asahi/vulkan/hk_apple9_trace.h |
Declares categorized diagnostics. |
src/asahi/vulkan/hk_apple9_trace.c |
Implements bounded rendering diagnostics. |
src/asahi/vulkan/hk_apple9_softfp64.h |
Defines the FP64 cache and lowering interface. |
src/asahi/vulkan/hk_apple9_softfp64.c |
Imports and inlines software FP64 operations. |
src/asahi/vulkan/hk_apple9_root.h |
Declares native root-descriptor lowering. |
src/asahi/vulkan/hk_apple9_root.c |
Resolves root and descriptor-set addresses. |
src/asahi/vulkan/hk_apple9_msaa.h |
Declares tile and multisample helpers. |
src/asahi/vulkan/hk_apple9_msaa.c |
Builds native tile layouts and clear/reload/store shaders. |
src/asahi/vulkan/hk_apple9_graphics.h |
Defines native graphics state and encoding interfaces. |
src/asahi/vulkan/hk_apple9_coopmat.h |
Guards against residual cooperative-matrix operations. |
src/asahi/lib/tests/test-tilebuffer.cpp |
Tests native single-color tile layouts. |
src/asahi/lib/meson.build |
Registers shared compute and geometry helpers. |
src/asahi/lib/agx_bo.h |
Tracks read-only shadow mappings per buffer object. |
src/asahi/lib/agx_bg_eot.c |
Adapts precompiled-kernel memory qualifiers. |
src/asahi/lib/agx_apple9_launch.h |
Updates shared launcher declarations and C linkage. |
src/asahi/lib/agx_apple9_launch.c |
Adds allocation experiments and larger launch encodings. |
src/asahi/lib/agx_apple9_geometry.c |
Uses the shared compute header. |
src/asahi/lib/agx_apple9_compute.h |
Centralizes compute launch and sampler interfaces. |
src/asahi/layout/tests/test-layout.cpp |
Tests two-layer linear transfer footprints. |
src/asahi/compiler/test/test-apple9-tg-experiment.cpp |
Tests experimental threadgroup allocation limits. |
src/asahi/compiler/test/test-apple9-meta-upload.cpp |
Tests transfer addressing and native compilation. |
src/asahi/compiler/test/test-apple9-fp64.cpp |
Tests integer helpers and raw-double rejection. |
src/asahi/compiler/test/test-apple9-descriptors.cpp |
Tests root-based buffer access compilation. |
src/asahi/compiler/test/test-apple9-coopmat-machine.cpp |
Tests matrix lowering through native compilation. |
src/asahi/compiler/meson.build |
Registers lowering code and compiler tests. |
src/asahi/compiler/agx_nir.h |
Declares cooperative-matrix lowering. |
src/asahi/compiler/agx_nir_lower_apple9_math.c |
Lowers interleave and reduced-angle sine operations. |
src/asahi/compiler/agx_nir_lower_apple9_cooperative_matrix.c |
Implements bounded subgroup matrix lowering. |
src/asahi/compiler/agx_compile.h |
Exposes native preprocessing and sample-lowering interfaces. |
src/asahi/compiler/agx_compile.c |
Separates native fragment-side-effect preprocessing. |
src/asahi/compiler/agx_compile_apple9.h |
Extends native formats, system values and robust vertex interfaces. |
src/asahi/compiler/agx_apple9_profile.h |
Defines allocation limits and experiment state. |
Review effort: Balanced
| prog_python, '@INPUT@', '@OUTPUT@', prog_glslang, | ||
| '--vn', 'hk_float64_spv', '--glsl-version', '450', '-Olib', | ||
| glslang_depfile, |
| for (unsigned i = 0; i < num_draws; i++) | ||
| util_draw_vbo_without_prim_restart(pctx, dinfo, drawid_offset + i, | ||
| NULL, &draws[i]); |
| util_draw_vbo_without_prim_restart(pctx, dinfo, drawid_offset + i, | ||
| NULL, &draws[i]); |
| if (sample_size_B * samples * tile_size > 32767) | ||
| return false; |
| features->vertexInputDynamicState = false; | ||
| features->extendedDynamicState = false; |
The Honeykrisp FP64 target always invokes glslangValidator. Require the tool for Asahi Vulkan so an Asahi-only configuration reports the missing dependency before using its depfile settings. Co-authored-by: sisyphus-dev-ai <[email protected]>
Filter image-format sample counts through the same tilebuffer admission used when native rendering begins. RGBA32 2x and 4x targets exceed the reserved 32-KiB tile budget and must not be advertised. The public Vulkan query regression changes from three sample-count failures to none, while RGBA8 and RGBA16 float retain 1x, 2x and 4x. Co-authored-by: sisyphus-dev-ai <[email protected]>
Native graphics rejects geometry and tessellation stages, sample shading, alpha-to-one, non-solid fill, and non-timestamp query pools. Clear the corresponding feature bits and the dependent shader point-size feature. The public Vulkan feature query regression changes from eight failures to none on M4. Co-authored-by: sisyphus-dev-ai <[email protected]>
Submit each restart-free range separately with its logical draw ID. This keeps increment_draw_id from advancing between segments and lets drivers upload every client index range. Honor the flag when advancing between the original Zink draws. Exercise the production Zink entry point and real upload manager with user/resource indices, 16/32-bit widths, both ID modes, nonzero starts and draw-ID offsets, and distinct base vertices. All eight new cases fail before the fix and pass after it. Co-authored-by: sisyphus-dev-ai <[email protected]>
Preserve the draw ID supplied by the Vulkan draw loop and publish it in vertex sysval word 2. Lower load_draw_id through the same uniform path as first/base vertex and first instance. The slot precedes sampler bias data at byte 16. Native multidraw now observes nonzero IDs instead of rejecting the vertex shader. The existing base-parameter words retain their offsets. Co-authored-by: sisyphus-dev-ai <[email protected]>
GL batch pools grow from 16 KiB to 256 KiB slabs instead of starting at 256 KiB, VDM encoders start at 16 KiB (CDM keeps 512 KiB), and a submit reaps every completed batch rather than at most two. Plasma shell drops from 43-128 MB to about 5 MB of GPU memory. Driver-side only; codegen identity unchanged.
On Apple9 the texture transfer mode is DEFAULT, so glReadPixels and texture maps of imported buffers read the BO directly from the CPU. agx_prepare_for_map only synced this context's writers, so a reader in another process could see a buffer another process was still rendering. KRdp hit this: it downloads each KWin screencast dma-buf with glReadPixels right after KWin's glFlush, and under GPU load from a game it captured frames with an unfinished, tile-ragged band (popups missing, the window below showing through). Wait on the dma-buf's implicit fences for shared BOs: writers before a CPU read, writers and readers before a CPU write. Generated-by: LLM
…ae2d7b) Fixes torn KRdp/screencast captures: CPU readback of a shared dma-buf now waits for its implicit fences.
… memory hk_defer_render_wait() lets a render's tiling start before earlier renders' fragment work finishes when its pre-rasterization stages cannot observe that work. The rule assumed vertex pipelines never store, but vertexPipelineStoresAndAtomics is exposed on G16 (and to DXVK/vkd3d), and the classifier only looks at loads. A vertex, task or mesh shader that stores or runs atomics after a FRAGMENT_SHADER -> VERTEX_SHADER barrier could then overwrite memory an earlier render's fragment shader had not yet read (write-after-read) or written (write-after-write). Mark draws whose bound pre-rasterization shaders write memory and never elide their render's tiling wait. Transform feedback, tessellation and geometry already keep it. HK_TILING_ELISION_STATS counts these renders as "stores". Generated-by: LLM
Render 1's fragment shader spins and then reads a buffer into its attachment; after a FRAGMENT_SHADER -> VERTEX_SHADER barrier, render 2's vertex shader stores to that buffer. Every pixel must see the old value. Each round uses a fresh device, since the first render pair of a queue is the one the tiling-wait elision could reorder. On the M4 mini, 8 of 20 rounds failed before the tiling-wait fix and 0 of 20 after it, and 0 of 20 with the elision disabled. Generated-by: LLM
asahi-agx2-fails.txt is upstream's expected-failure list for M1-class CI. Restore its upstream content and move the M4 (G16) expectations to asahi-m4-fails.txt, which the M4 runner now reads instead, so nothing carried here changes M1 CI expectations. Generated-by: LLM
Every process that enumerated Vulkan devices (vulkaninfo, Steam, every game) printed "WARNING: experimental Apple9 Honeykrisp; not conformant" to stderr. The conformance version in VkPhysicalDeviceDriverProperties already reports that the implementation is not conformant. Generated-by: LLM
DXVK and vkd3d run with border emulation disabled (driconf), so the first sampler with a custom border colour printed six lines to stderr saying the border would be wrong. On G16 the hardware applies a custom border with a known format natively, so the warning is false there. Print it only when the border really needed emulation. Generated-by: LLM
HK_ABORT_BEFORE_SUBMIT and HK_NULL_SUBMIT were looked up in the environment on every queue submit. Read each once, as the other hk debug options are. Generated-by: LLM
-Dhk-gpu-busy-counters defaulted to true, so every build carried the collector, although its documentation says the option defaults off. With HK_GPU_BUSY_FILE unset every entry point already returns before touching a command or allocating anything, so compiling the counters out does not change what the driver records or submits. Default the option to false; measurement builds keep enabling it with -Dhk-gpu-busy-counters=true. Generated-by: LLM
Scalar exports complete in the publication namespace. A GPR instruction which overwrites one of their borrowed inputs must not consume that completion through its own GPR dependency field. Check publication consumers before the generic ordering-only shortcut. This emits a standalone wait before GPR reuse while keeping folded waits for the matching varying, grid-export and coverage consumers. Exercise the physical completion pass and packer with both scalar export forms, ALU and load overwrites, and one through six pending publications. Keep the physical allocation fixed and retain shared inputs between the publishers so allocation cannot hide the missing handoff. Generated-by: LLM
Mark the last vertex stage dirty when changing the draw-ID source. The pipeline update gate consumes dirty_gfx_stages before the program updater can propagate last_vertex_stage_dirty, so the key change must make the stage visible to that gate. Fixes logical draw ID 1 incorrectly using native DrawIndex 0 after primitive restart splits. All four exact-ID GPU cases, MSAA, timestamps and all seven CPU test targets pass.
Share native Z/S attachment validation and ZLS setup between colored and colorless rendering. Treat a null color slot as colorless while retaining real depth/stencil dimensions, samples, loads and stores. Ignore clear values for LOAD and DONT_CARE. The public GL regression changes six color-preservation failures and a teardown timeout to zero bad pixels and normal exit. All seven CPU targets and adjacent GPU regressions pass; normal-profile Maps acceptance remains separate.
Native buffer/image transfers reject block-compressed images in both directions. Clear the compression feature bits and format features on the native path so clients select supported texture representations. Verified all seven CPU targets and 28 public Vulkan capability checks on Apple M4.
Meta clear shaders only write attachments selected in the clear mask. Disable color writes for the other bound attachments so undefined fragment outputs cannot overwrite their existing contents. This also preserves color during depth-only and stencil-only clears. The public GL regression keeps all 16 earlier cases and adds six depth-tested color-preservation cases. Those six fail without the fix; all 22 pass with it under both default and unthreaded Zink. Seven CPU targets also pass.
Adopt the current native renderer and retain the validated FP64, descriptor, MSAA, DrawID and meta-clear behavior at their shared owners. Preserve split-address alignment, wide robust index offsets, and late NEVER depth/stencil ordering. Retire superseded private backends and move their live coverage to the canonical interfaces.
Known client-side visibility gap: Linux Vulkan clients that omit portability enumerationThe driver reports
With both gates open (a local wgpu build carrying the one-line fix below, plus the flag), the G16G enumerates and a device opens at default limits: Recommended downstream edit (one line, no-op where the extension is absent; Filed upstream for tracking: gfx-rs/wgpu#11121 (issue) and gfx-rs/wgpu#11122 (PR carrying the edit against trunk). No driver-side change is indicated: instance creation, device enumeration, downlevel capability reporting and compute availability all behave per spec once the client sets the portability bit and opts in. |


Apple9/G16G native Vulkan bring-up used by Zink on an M4 J715 desktop.
The head is
ad9f485bf72b607c65f46a8ac0e1e68c126bca6e. It contains thetested upstream merge
ad4404e0360145f6ca1d1aa03ad1e8b4820f7422, followedby a one-line test-fixture correction that removes a sample-mask narrowing
warning. Production source is identical to the M4-tested merge.
Stacked on #2: its exact five commits through
b479054remain unchanged.All previously published commits through
aa05e78are preserved.Upstream integration
The merge takes upstream snapshot
f66f380c648551249df5ba8538983279ca800985as its second parent.There is no rebase or history rewrite.
The implementation now uses the current native renderer, shared launch
and geometry interfaces, native descriptor ABI and tile layout. Superseded
private backends are removed; their meaningful compiler, descriptor, MSAA
and index cases run against the current owners.
The integration retains software FP64, narrow-integer arithmetic,
DrawID/restart behavior, mip and attachmentless rendering, and the shared
meta-clear fix for uncleared color attachments. It also fixes:
offset alone.
zero-page decision and copy-source calculation.
depth export now makes the substituted hardware test fail even without
an explicit FragDepth output or depth/stencil feedback loop.
by software FP64 helpers.
The alignment, index and NEVER changes have failing-before/passing-after
tests at their production owners. The initial independent review found
the latter two gaps; they are fixed and covered by the tests below.
Validation
Builds ran on aarch64 DGX. A coherent seven-library runtime from
ad4404ewas pinned by SHA-256 and tested in a private M4 prefix.
All reported CTS results are Pass, not NotSupported. The strengthened
NEVER probe clears depth to .75 while the fragment's interpolated depth is
.5: an accidental LESS would pass and is detected by both depth and stencil
checks, rather than being hidden by preserved color.
The unchanged capability probe from
aa05e78expects the former backend'sfeature exclusions and therefore reports 26 differences. The current
upstream backend advertises those features, compressed formats and wide
MSAA; the additional CTS and pixel tests above verify their delivery.
That old probe is retained and is not represented as a passing test.
Raw logs, QPAs, manifests, probe sources and the acceptance record are in:
/mnt/w/mesa-ffnative-01a179c0/run/pr3-upstream-20261116-w86/.Earlier series and desktop acceptance
The original series shares launch/geometry helpers (
30e2fa8), adds thecompute compiler support and snapshot (
02adc29,fe2d172), then nativegraphics (
d0f5a14) and fragment side effects (d0396ba).The Maps fixes through
4831e52cover mip attachments, attachmentlessrendering, D32 transfers, pending clears, packed UFLOAT and depth-one 3D
sampling. The following nine commits through
aa05e78address the reviewfindings, DrawID, Z/S-only rendering, unsupported old-backend capability
advertisement and meta-clear color preservation.
The installed normal Firefox/Maps acceptance remains specifically for
aa05e78: original launcher and profile, native WebGL1, complete Globe andterrain/traffic imagery, pointer pan/zoom, no context loss and 17 passing
manual QA rows. This refresh did not replace that installed runtime or
restart the compositor. It does not claim new normal-profile browser
acceptance for the private prefix.
Remaining scope
vkGetPipelineCacheData (VK_INCOMPLETE)diagnostics from the unchangedupstream cache exporter; those diagnostics are not claimed fixed.
are not claimed. No compositor restart or reboot was performed.