Repository navigation
Conversation
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Assisted-By: OpenAI Codex (GPT-5.6 Sol)
Use a depth of one for each 1D array image during texture finalization instead of the resource layer count, matching its image dimensions. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
…hader Admit triangles, triangle strips and triangle fans for triangle transform feedback without a geometry shader. Preserve quad and polygon modes only in desktop compatibility profiles; exclude adjacency modes requiring a geometry stage. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Normalize passthrough geometry primitive-ID inputs before creating compute and raster variants. Retain each stream's transform-feedback count and suppress captures for dummy culled primitives when an invocation emitted no primitives. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Cache device debug and direct-submit settings during initialization and share compiler tracing through a single helper. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Expose common compiler lowering helpers, move MSAA lowering into the compiler, and serialize portable library NIR for Apple9 linking. Share sample-position and printf support between compiler paths. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Track loop break predicate banks through lowering and encoding, with focused compiler coverage. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Model integer unary and binary16 operations in Apple9 IR, optimization and machine encoding. Lower narrow conversions through the native operation model and add compiler and Piglit regression coverage. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Add IR and encoding support for memory, scans, fences and indirect atomic operations, and account for their operand constraints during register allocation. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Integrate Apple9 compute, geometry and raster shader lowering with descriptor, varying and launch interfaces. Extend resource addressing, texture and sample operations, scratch limits and compiler regression coverage through the normal shader pipeline. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Update blit and resolve paths for layered resources and tile helper preparation. Keep helper dispatch state and render synchronization consistent with the shader launch interfaces. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Track resource access by render stage, synchronize cross-context CPU access with pending writers, and retire completed batches when finishing contexts. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Provide native M4 test profiles and runner tooling using upstream expectations, with documented deployment and result provenance. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Update compiler and driver documentation with the captured implementation state and existing hardware results, and point DRM shim users to current launcher documentation. Validation: Asahi compiler, layout, geometry, launcher and GLSL function-scope tests. Gallium, EGL, DRM shim, GLSL compiler and compute runner builds; GLES fixture compiled with -Werror. No hardware run for this snapshot split. Assisted-By: OpenAI Codex (GPT-6 Astra)
Enable the Apple9 graphics path for G16G and G17P without requiring AGX_APPLE9_DIRECT_RENDER. Keep the existing hardware guard and remove obsolete launcher exports and documentation. Validation: git diff --check, shell syntax checks, and Python AST parsing. No hardware run for this change. Assisted-By: OpenAI Codex (GPT-6 Astra) Signed-off-by: Niklas Sheth <[email protected]>
Accept VARYING_SLOT_CLIP_VERTEX in the shared varying predicate so compatibility shaders writing gl_ClipVertex pass signature validation and use the existing export path, including when user clipping is disabled. No special cleanup pass or new instruction encoding is needed. Add regressions for ordinary export with clip distances, reads of the output variable, transform-feedback compilation, and the publication capacity boundary. Clip vertex consumes four of the current 96 export components. Report the rejected vertex output or missing position when signature validation fails. Validation: isolated Asahi compiler test suite and Gallium driver build. Native M4 regression probes previously passed rendering, clipping toggles, output reads, and capture with clipping disabled, plus GL 3.3/GLES 3.0 smoke tests. The existing combined clipping/capture failure remains. Assisted-By: OpenAI Codex (GPT-6 Astra) Signed-off-by: Niklas Sheth <[email protected]>
57e72df to
9c8bfc8
Compare
|
Correction pushed (tip 9c8bfc8). The first version of commit 4 only widened shifts, min/max and the high-multiply, and its message said integer comparisons were already widened. That is true of the longer series (#3) but not of main, so on main the |
9c8bfc8 to
833eb5a
Compare
|
Pushed a fix to commit 4 (tip 833eb5a). A review found that on main the width lowering ran only once, and the algebraic passes after it folded widened comparisons back to 16 bits: a 16-bit |
833eb5a to
97700ee
Compare
|
Pushed 97700ee after another review round. Commit 3 (zink: skip draws whose graphics pipeline could not be created) only dropped the first draw: zink_get_gfx_pipeline had already consumed the dirty state, so an identical next draw skipped the pipeline update and was rendered with the previously bound pipeline, and a cache hit on the failed creation set the tracked pipeline to VK_NULL_HANDLE. It now keeps a failure flag on the context that sends every following draw back through the lookup (past the vertex-input fast path) and drops it until a lookup succeeds, reports a cached failed creation as a failure without tracking it, and folds the state hashes out of final_hash unconditionally. A GL probe on the Apple9 series reproduced the stale-pipeline draw before and passes after. Commit 1's message is rewrapped; commits 2 and 4 are unchanged apart from their parents. |
Honeykrisp has no VK_KHR_unified_image_layouts, so general_layout is false. Enabling render-pass tracking violates the !track_renderpasses || general_layout assertion in zink_clear.c and also triggers the render-pass consistency assertion in zink_update_barriers. Leave tracking disabled instead of forcing depth stores.
dynamicPrimitiveTopologyUnrestricted lets one pipeline be drawn with any topology, but only when VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY is dynamic, and zink makes it dynamic only with EXT_extended_dynamic_state. Without that, the topology is baked into each pipeline, yet the property still put every topology in pipeline slot 0, so a pipeline created for one topology was reused for draws with another. The in-progress Apple9 graphics path for Honeykrisp does not expose extendedDynamicState but keeps the property. Chromium (Signal) drew 4-vertex triangle strips with a cached triangle-list pipeline, so only the first triangle of its logo quad reached the screen; with back-face culling, a 6-vertex list drawn with a cached strip pipeline lost its second triangle. Only use the shared slot when topology is dynamic.
update_gfx_pipeline asserted that a pipeline was returned and otherwise bound VK_NULL_HANDLE. Pipeline creation can fail: out of memory, or a driver that cannot express the state (the in-progress Apple9 graphics path for Honeykrisp rejected vertex shaders that write gl_PointSize with VK_ERROR_FEATURE_NOT_PRESENT). Firefox then aborted as soon as audreyt.org created its WebGL2 point sprites. Report the failure once and drop the draw. By then zink_get_gfx_pipeline has consumed the dirty state, so an identical next draw would skip the pipeline update and draw with the previously bound pipeline. Keep a failure flag on the context instead: it sends every following draw through the pipeline lookup, past the vertex-input fast path, and drops it until a lookup succeeds. A dropped draw may also have consumed state changes that zink_draw emits only after the pipeline update, such as a dynamic primitive topology. Mark the graphics state as changed, as after a mesh draw, so the next draw takes the batch-changed path and re-emits all of it. A failed creation stays in the pipeline cache without a pipeline. Treat a cache hit on it as a failure rather than tracking a null pipeline, so the previously bound pipeline stays bound and tracked. The state and vertex hashes start at zero and stay folded into final_hash when creation fails, so fold the old value out unconditionally instead of only once a pipeline exists.
A narrow (8- or 16-bit) integer keeps only its low bits in a 32-bit GPR; narrowing conversions leave the upper bits as they were. Operations that read past the low bits then give wrong results: integer comparisons, right shifts, imin/imax/umin/umax, and imul_high/umul_high, which nir_opt_idiv_const emits for a division by a constant and which were lowered as the high word of a 32x32 product. Zink on Honeykrisp reports shaderInt16, so GLES contexts get mediump ints in fragment shaders lowered to 16 bits and this hits real content. WebRender's multi-stop gradient lookup walks a tree with "index_stride /= 5" and clamps the stop index with "index > count - 1"; on the in-progress Apple9 graphics path the division returned 0 and the clamp was lost, so gradients with more than two stops drew bands, flat discs and stray colours past the last stop in Firefox. Evaluate narrow integer comparisons and every other narrow integer ALU op except conversions, moves and selects at 32 bits. nir_lower_bit_size extends the sources explicitly and takes the high half of the 32-bit product for imul_high/umul_high. The algebraic passes that follow can fold a widened comparison back to its narrow form (a clamp becomes a 16-bit imin), so widen again after the last of them, and reject a narrow integer ALU op that still reaches instruction selection instead of miscompiling it. Export the width callback as agx_apple9_alu_width, and add tests for which operations it widens and that narrow integer shaders compile.
97700ee to
dcf6d0d
Compare
|
Pushed dcf6d0d. Commit 3 now also marks the graphics state as changed when it drops a draw (what zink already does after a mesh draw), so the next draw takes the batch-changed path and re-emits all dynamic state. Without it, a dropped draw could consume a topology change before vkCmdSetPrimitiveTopology was emitted, and on a driver with dynamic topology the recovery draw would run with the previous topology. Honeykrisp bakes topology into each pipeline, so that case cannot be exercised here; the GL failure probe and the rest of the hardware validation pass on the Apple9 series with this change. Commits 1, 2 and 4 are unchanged apart from their parents. |
… topology Without dynamic primitive topology the topology is baked into each pipeline, and zink keeps one pipeline slot per topology. zink_draw only looked the pipeline up again when other state was dirty, when the rasterization primitive class changed, or when the batch changed. A pure change between two topologies of the same class, such as a triangle list followed by a triangle strip, therefore kept the previously bound pipeline. A strip drawn after a list used the list pipeline and lost the second triangle of every four-vertex quad. Chromium (Signal) then drew half of each message bubble and of the composer bar. Also look the pipeline up again when the topology changes and topology is not dynamic.
Five commits on
mainthat apply and build (the CPU tests were run for commits 1-4) without the rest of the Apple9graphics work. They come from a longer series (#3, draft) that runs a
Zink-on-Honeykrisp desktop on an Apple M4 (G16G, J715 MacBook Air): Firefox with WebRender,
Signal with GPU rasterization.
Commits
zink: don't track render passes on Honeykrisp. Honeykrisp has no
VK_KHR_unified_image_layouts, sogeneral_layoutis false while TC render-pass tracking ison. Firefox hit both asserts that live under that combination:
!ctx->track_renderpasses || screen->driver_workarounds.general_layoutinzink_clearand!check_rp || check_rp == ctx->in_rpinzink_update_barriers. Same effect asZINK_DEBUG=norp; the cost is a full attachment load/store per pass.zink: don't share pipelines across topologies without dynamic topology.
dynamicPrimitiveTopologyUnrestrictedlets one pipeline serve every topology only whenVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGYis dynamic, which zink enables only withEXT_extended_dynamic_state. Without it the topology is baked into each pipeline, yet everytopology still used pipeline slot 0, so Signal drew 4-vertex triangle strips with a cached
triangle-list pipeline and only half of its logo appeared. Not Honeykrisp-specific.
zink: skip draws whose graphics pipeline could not be created. Report the failure once and
drop the draw instead of
assert(pipeline)and bindingVK_NULL_HANDLE. By thenzink_get_gfx_pipelinehas consumed the dirty state, so a context flag sends every followingdraw back through the pipeline lookup (past the vertex-input fast path) and drops it until a
lookup succeeds. A failed creation stays cached without a pipeline; a hit on it is reported as
a failure instead of becoming the tracked pipeline, and the state hashes are folded out of
final_hashunconditionally, since a context can now have hashed state without a pipeline.The previously bound pipeline stays bound and tracked. Not Honeykrisp-specific either.
A dropped draw may also have consumed state changes that
zink_drawemits only after thepipeline update, such as a dynamic primitive topology, so the graphics state is marked
changed (as after a mesh draw) and the next draw takes the batch-changed path and re-emits
all of it. Honeykrisp has no
EXT_extended_dynamic_state, so topology is baked into eachpipeline there and the dynamic-topology case cannot be exercised on this hardware.
asahi/apple9: evaluate narrow integer math at 32 bits. A narrow integer keeps only its low
bits in a 32-bit GPR, and narrowing conversions leave the upper bits as they were, so
integer comparisons, right shifts,
imin/imax/umin/umaxandimul_high/umul_high(which
nir_opt_idiv_constemits for a division by a constant) read garbage. Narrow integercomparisons and every other narrow integer ALU op except conversions, moves and selects are
now evaluated at 32 bits. The algebraic passes after the width lowering can fold a widened
comparison back to 16 bits (a clamp becomes a 16-bit
imin), so the lowering runs againafter the last of them, and a narrow integer ALU op that still reaches instruction selection
is rejected instead of being miscompiled. GLES contexts get mediump fragment
ints lowered to 16 bits (Zink on Honeykrisp reports
shaderInt16), so this hit WebRender: itsmulti-stop gradient lookup divides by 5 and clamps an index, and gradients with more than two
stops drew bands, flat discs and stray colours past their last stop. The change is in the
shared Apple9 compiler, so gallium asahi shaders are affected too; I only tested through Zink.
zink: select the pipeline again when topology changes without dynamic topology.
Without dynamic topology each pipeline has its topology baked in, but
zink_drawlooked thepipeline up again only when other state was dirty, the rasterization primitive class changed
or the batch changed. A change between two topologies of the same class, such as a triangle
list followed by a triangle strip, kept the previous pipeline, so a strip drawn after a list
lost the second triangle of every four-vertex quad: Signal drew half of each message bubble
and of its composer bar. Commit 2 fixed the pipeline slot but not this lookup. Not
Honeykrisp-specific; it applies whenever topology is not dynamic.
Testing
main(aarch64, debugoptimized,-Dgallium-drivers=asahi,zink -Dvulkan-drivers=asahi -Dbuild-tests=true):agx_tests366/366 on commits 1-3 and 368/368 on commit 4 (two new tests),
libasahi_tests5/5,zink_format_testpass;git diff --checkis clean.git merge-treewith asahi: fixes enabling sway, zathura and mpv on Apple M4 mini #1 is clean.series, not on
mainalone, becausemainhas no Apple9 Vulkan graphics path:failed every mediump case before commit 4 and passes after; the same source with
precision highp intpassed before. A second probe checks 15 mediump integer expressionsfrom that lookup and passes after commit 4; before it, the index clamp and the highp address
arithmetic were wrong.
sections now match software WebRender, and the page stays responsive.
crashes.
assert(pipeline)(commit 3).
and restart-index strip draws without changing any other state: draws after a list lost half of each
quad (15300 pixels missing) before commit 5 and none are missing after. Signal, with one avatar clicked
repeatedly, no longer clips its message bubbles or composer bar. Commit 5 was built on top of
commit 4 (libgallium only);
agx_testsand the other unit tests were not rerun for it, and thehardware run was on the longer series with this commit, not on
mainalone.fragment shader writes
gl_FragDepth(rejected by the Apple9 graphics path, so no pipeline can becreated), then valid draws again. With the previous version of commit 3 the second failed draw
was rendered with the previously bound pipeline (2 of 9 probe columns wrong); now every failed
draw is dropped and the following draws render correctly. The same sequence with only
GL_COLOR_LOGIC_OPtoggled (a pure pipeline-state change) passes before and after.NarrowIntegerMathIsEvaluatedAt32Bitschecks which operations thewidth callback widens.
NarrowIntegerShadersReachSelectionWidenedcompiles 16-bit comparison,clamp, min/max, shift, add and multiply shaders through the Apple9 compiler; with the second
widening removed, the comparison and clamp shaders are rejected, so it fails. On this tree a
16-bit division by a constant is still rejected by the Apple9 compute compiler
("unsupported NIR"), with or without this change.
dEQP-VK.spirv_assembly.type.*.{i16,u16}.*_{comp,frag}(1100 cases), on the longer series with and without this change: 456 pass before, 552 after, no case regressed. The 96 newly passing cases are all compute and all gave wrong output before. The 548 remaining failures are all fragment cases that fail identically on both builds invkCreateGraphicsPipelines(VK_ERROR_FEATURE_NOT_PRESENT), unrelated to this change. Not run onmainalone, which has no Apple9 Vulkan graphics path.