Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Vulkan feature-extractor pipeline setup by extending the Vulkan kernel template with a “pipeline variant” helper and migrating the Vulkan motion + SSIM extractors to use the shared template-owned pipeline bundle.
Changes:
- Add
vmaf_vulkan_kernel_pipeline_add_variant()to create additional compute pipelines that reuse the base pipeline’s layout + shader (variant differs via spec constants). - Migrate
motion_vulkan.cto a single template-ownedVmafVulkanKernelPipeline(removing the dormant 2-pipeline state). - Migrate
ssim_vulkan.cto a template-owned base pipeline (pass=0) plus a sibling variant pipeline for pass=1.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| libvmaf/src/vulkan/kernel_template.h | Adds the “add variant pipeline” helper to support multi-pipeline kernels sharing the same bundle resources. |
| libvmaf/src/feature/vulkan/motion_vulkan.c | Switches motion to use the kernel template bundle and collapses to one pipeline. |
| libvmaf/src/feature/vulkan/ssim_vulkan.c | Switches SSIM to use the kernel template bundle and creates a second pipeline via the new variant helper. |
| docs/rebase-notes.md | Adds rebase note entry documenting the refactor and invariants. |
| CHANGELOG.md | Adds an Unreleased “Changed” entry describing the migration and new helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+382
to
+383
| * spec-constant — `motion_vulkan.c` (compute-SAD on/off for | ||
| * first frame vs subsequent), `ssim_vulkan.c` (horizontal vs |
Comment on lines
+405
to
+410
| VkComputePipelineCreateInfo cpci = *variant_info; | ||
| cpci.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; | ||
| cpci.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; | ||
| cpci.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; | ||
| cpci.stage.module = base->shader; | ||
| cpci.layout = base->pipeline_layout; |
| return 0; | ||
| /* Pass 1 (vertical) — same layout/shader/DSL/pool, different | ||
| * spec-constant. */ | ||
| return build_pipeline_for_pass(s, /*pass_id=*/1, &s->pipeline_vert); |
Comment on lines
510
to
+517
| VkDevice dev = s->ctx->device; | ||
| vkDeviceWaitIdle(dev); | ||
|
|
||
| if (s->desc_pool != VK_NULL_HANDLE) | ||
| vkDestroyDescriptorPool(dev, s->desc_pool, NULL); | ||
| if (s->pipeline_horiz != VK_NULL_HANDLE) | ||
| vkDestroyPipeline(dev, s->pipeline_horiz, NULL); | ||
| /* Destroy the sibling variant first; the base pipeline and the | ||
| * shared layout/shader/DSL/pool are owned by the template. */ | ||
| if (s->pipeline_vert != VK_NULL_HANDLE) | ||
| vkDestroyPipeline(dev, s->pipeline_vert, NULL); | ||
| if (s->shader != VK_NULL_HANDLE) | ||
| vkDestroyShaderModule(dev, s->shader, NULL); | ||
| if (s->pipeline_layout != VK_NULL_HANDLE) | ||
| vkDestroyPipelineLayout(dev, s->pipeline_layout, NULL); | ||
| if (s->dsl != VK_NULL_HANDLE) | ||
| vkDestroyDescriptorSetLayout(dev, s->dsl, NULL); | ||
| vmaf_vulkan_kernel_pipeline_destroy(s->ctx, &s->pl); |
Comment on lines
+92
to
+114
| - **Vulkan kernel template — multi-pipeline support + ssim/motion | ||
| migration (T-GPU-DEDUP-7).** Extended | ||
| [`libvmaf/src/vulkan/kernel_template.h`](libvmaf/src/vulkan/kernel_template.h) | ||
| with `vmaf_vulkan_kernel_pipeline_add_variant()` so kernels that | ||
| need multiple `VkPipeline`s sharing one layout / shader / DSL / | ||
| descriptor pool (different spec-constant) can express that | ||
| without re-implementing the boilerplate. Migrated | ||
| [`libvmaf/src/feature/vulkan/motion_vulkan.c`](libvmaf/src/feature/vulkan/motion_vulkan.c) | ||
| and | ||
| [`libvmaf/src/feature/vulkan/ssim_vulkan.c`](libvmaf/src/feature/vulkan/ssim_vulkan.c) | ||
| to the template — net duplicated DSL / pipeline layout / shader / | ||
| pipeline / descriptor-pool create-and-destroy code removed. As | ||
| part of motion's migration, the dormant `pipelines[2]` array | ||
| (kept "for SYCL parity" but functionally identical because | ||
| COMPUTE_SAD is passed via push constants, not spec-constants) was | ||
| collapsed to a single `VkPipeline`. SSIM still owns two pipelines | ||
| (horizontal pass=0 / vertical pass=1 differ in spec constant) — | ||
| pass=0 is the template's base pipeline; pass=1 is attached via | ||
| `_add_variant()`. Validated against the Netflix-pair smoke | ||
| (`float_ssim` mean 0.863, 48 frames) + `meson test | ||
| test_vulkan_smoke test_vulkan_async_pending_fence | ||
| test_vulkan_pic_preallocation` (all green). | ||
|
|
1a7ee8f to
0cad1f3
Compare
This was referenced May 2, 2026
Merged
Merged
Merged
Merged
0cad1f3 to
af40030
Compare
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
Multi-pipeline-via-variant migration on top of PR #272. State collapses dsl + pipeline_layout + shader + desc_pool + pipelines[4] to VmafVulkanKernelPipeline pl + VkPipeline scale_variants[3]. Scale 0 (luma) is the template's base pipeline; scales 1, 2, 3 are sibling pipelines via _add_variant() — same layout, shader, DSL, pool, different SCALE spec-constant. New vif_scale_pipeline() accessor maps scale index to the right VkPipeline handle. close_fex destroys the 3 scale variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7 and psnr_hvs_vulkan in T-GPU-DEDUP-18). Validated against the Netflix-pair smoke (integer_vif_scale0..3 means 0.364, 0.767, 0.863, 0.916, integer_vif mean 0.446 across 48 frames). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0119) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
16-pipeline 2-D [stage][scale] array (4 stages × 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants (every (stage, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle — the (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0121) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Twin migration to adm_vulkan (T-GPU-DEDUP-21); same 16-pipeline 2-D [stage][scale] shape (4 stages * 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. The (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0122) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Hardest variant case — 7 pipelines across a 2-D [mode][scale] array (mode 0 compute scales 0-3, mode 1 decimate scales 1-3). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[2][4] 2-D lookup is preserved so the existing [mode][scale] dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 6 entries are sibling pipelines via _add_variant(). close_fex destroys the 6 sibling variants (every (mode, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. Same rule as ssim_vulkan / psnr_hvs_vulkan / vif_vulkan; the (0, 0) skip is the float_vif-specific invariant (pipeline aliasing). Validated against the Netflix-pair smoke (vif_scale0..3 means 0.364, 0.767, 0.863, 0.916 across 48 frames; matches integer_vif bit-identically to 4 decimals). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0120) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…template First multi-pipeline-via-variant consumer landed on top of PR #272 (which adds the vmaf_vulkan_kernel_pipeline_add_variant() helper). State collapses dsl + pipeline_layout + shader + desc_pool + pipeline[3] to VmafVulkanKernelPipeline pl + VkPipeline pipeline_chroma_u + VkPipeline pipeline_chroma_v. Plane 0 (luma) is the template's base pipeline; planes 1+2 (chroma U/V) are sibling pipelines via _add_variant() — same layout + shader + DSL + pool, different plane spec-constant. New psnr_hvs_plane_pipeline() accessor maps plane index to the right VkPipeline handle. close_fex destroys the chroma U/V variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7). Validated against the Netflix-pair smoke (psnr_hvs mean 31.33, psnr_hvs_y 30.58, psnr_hvs_cb 37.26, psnr_hvs_cr 38.20 across 48 frames) + meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0118) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
10 tasks
…plate Extends libvmaf/src/vulkan/kernel_template.h with vmaf_vulkan_kernel_pipeline_add_variant() so kernels that need multiple VkPipelines sharing a layout / shader / DSL / pool (different spec-constant) can express that without re-implementing the boilerplate. motion_vulkan.c: collapses the dormant pipelines[2] array (kept "for SYCL parity" but functionally identical because COMPUTE_SAD goes through push constants, not spec-constants) to a single VmafVulkanKernelPipeline pl. create_pipelines / close_fex shrink to template-driven create + destroy. ssim_vulkan.c: state becomes VmafVulkanKernelPipeline pl + VkPipeline pipeline_vert. Pass 0 (horizontal) is the template's base pipeline; pass 1 (vertical) is created via _add_variant(). close_fex destroys the variant first, then calls vmaf_vulkan_kernel_pipeline_destroy(). Validated against the Netflix-pair smoke (float_ssim mean 0.863, 48 frames) + meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green). Numerical contract unchanged — both kernels run identical shaders + spec-constants + push-constants as before. CHANGELOG.md + docs/rebase-notes.md (entry 0106) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
af40030 to
2ed2ec8
Compare
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…template First multi-pipeline-via-variant consumer landed on top of PR #272 (which adds the vmaf_vulkan_kernel_pipeline_add_variant() helper). State collapses dsl + pipeline_layout + shader + desc_pool + pipeline[3] to VmafVulkanKernelPipeline pl + VkPipeline pipeline_chroma_u + VkPipeline pipeline_chroma_v. Plane 0 (luma) is the template's base pipeline; planes 1+2 (chroma U/V) are sibling pipelines via _add_variant() — same layout + shader + DSL + pool, different plane spec-constant. New psnr_hvs_plane_pipeline() accessor maps plane index to the right VkPipeline handle. close_fex destroys the chroma U/V variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7). Validated against the Netflix-pair smoke (psnr_hvs mean 31.33, psnr_hvs_y 30.58, psnr_hvs_cb 37.26, psnr_hvs_cr 38.20 across 48 frames) + meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0118) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…template First multi-pipeline-via-variant consumer landed on top of PR #272 (which adds the vmaf_vulkan_kernel_pipeline_add_variant() helper). State collapses dsl + pipeline_layout + shader + desc_pool + pipeline[3] to VmafVulkanKernelPipeline pl + VkPipeline pipeline_chroma_u + VkPipeline pipeline_chroma_v. Plane 0 (luma) is the template's base pipeline; planes 1+2 (chroma U/V) are sibling pipelines via _add_variant() — same layout + shader + DSL + pool, different plane spec-constant. New psnr_hvs_plane_pipeline() accessor maps plane index to the right VkPipeline handle. close_fex destroys the chroma U/V variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7). Validated against the Netflix-pair smoke (psnr_hvs mean 31.33, psnr_hvs_y 30.58, psnr_hvs_cb 37.26, psnr_hvs_cr 38.20 across 48 frames) + meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0118) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
May 2, 2026
…template (#284) First multi-pipeline-via-variant consumer landed on top of PR #272 (which adds the vmaf_vulkan_kernel_pipeline_add_variant() helper). State collapses dsl + pipeline_layout + shader + desc_pool + pipeline[3] to VmafVulkanKernelPipeline pl + VkPipeline pipeline_chroma_u + VkPipeline pipeline_chroma_v. Plane 0 (luma) is the template's base pipeline; planes 1+2 (chroma U/V) are sibling pipelines via _add_variant() — same layout + shader + DSL + pool, different plane spec-constant. New psnr_hvs_plane_pipeline() accessor maps plane index to the right VkPipeline handle. close_fex destroys the chroma U/V variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7). Validated against the Netflix-pair smoke (psnr_hvs mean 31.33, psnr_hvs_y 30.58, psnr_hvs_cb 37.26, psnr_hvs_cr 38.20 across 48 frames) + meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0118) updated per ADR-0108 deep-dive deliverables. Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
Multi-pipeline-via-variant migration on top of PR #272. State collapses dsl + pipeline_layout + shader + desc_pool + pipelines[4] to VmafVulkanKernelPipeline pl + VkPipeline scale_variants[3]. Scale 0 (luma) is the template's base pipeline; scales 1, 2, 3 are sibling pipelines via _add_variant() — same layout, shader, DSL, pool, different SCALE spec-constant. New vif_scale_pipeline() accessor maps scale index to the right VkPipeline handle. close_fex destroys the 3 scale variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7 and psnr_hvs_vulkan in T-GPU-DEDUP-18). Validated against the Netflix-pair smoke (integer_vif_scale0..3 means 0.364, 0.767, 0.863, 0.916, integer_vif mean 0.446 across 48 frames). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0119) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
May 2, 2026
…ate (#285) Multi-pipeline-via-variant migration on top of PR #272. State collapses dsl + pipeline_layout + shader + desc_pool + pipelines[4] to VmafVulkanKernelPipeline pl + VkPipeline scale_variants[3]. Scale 0 (luma) is the template's base pipeline; scales 1, 2, 3 are sibling pipelines via _add_variant() — same layout, shader, DSL, pool, different SCALE spec-constant. New vif_scale_pipeline() accessor maps scale index to the right VkPipeline handle. close_fex destroys the 3 scale variants first, then calls vmaf_vulkan_kernel_pipeline_destroy() on the bundle (same rule as ssim_vulkan in T-GPU-DEDUP-7 and psnr_hvs_vulkan in T-GPU-DEDUP-18). Validated against the Netflix-pair smoke (integer_vif_scale0..3 means 0.364, 0.767, 0.863, 0.916, integer_vif mean 0.446 across 48 frames). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0119) updated per ADR-0108 deep-dive deliverables. Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Hardest variant case — 7 pipelines across a 2-D [mode][scale] array (mode 0 compute scales 0-3, mode 1 decimate scales 1-3). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[2][4] 2-D lookup is preserved so the existing [mode][scale] dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 6 entries are sibling pipelines via _add_variant(). close_fex destroys the 6 sibling variants (every (mode, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. Same rule as ssim_vulkan / psnr_hvs_vulkan / vif_vulkan; the (0, 0) skip is the float_vif-specific invariant (pipeline aliasing). Validated against the Netflix-pair smoke (vif_scale0..3 means 0.364, 0.767, 0.863, 0.916 across 48 frames; matches integer_vif bit-identically to 4 decimals). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0120) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
16-pipeline 2-D [stage][scale] array (4 stages × 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants (every (stage, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle — the (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0121) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Twin migration to adm_vulkan (T-GPU-DEDUP-21); same 16-pipeline 2-D [stage][scale] shape (4 stages * 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. The (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0122) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
May 2, 2026
…_template (#286) Hardest variant case — 7 pipelines across a 2-D [mode][scale] array (mode 0 compute scales 0-3, mode 1 decimate scales 1-3). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[2][4] 2-D lookup is preserved so the existing [mode][scale] dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 6 entries are sibling pipelines via _add_variant(). close_fex destroys the 6 sibling variants (every (mode, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. Same rule as ssim_vulkan / psnr_hvs_vulkan / vif_vulkan; the (0, 0) skip is the float_vif-specific invariant (pipeline aliasing). Validated against the Netflix-pair smoke (vif_scale0..3 means 0.364, 0.767, 0.863, 0.916 across 48 frames; matches integer_vif bit-identically to 4 decimals). Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0120) updated per ADR-0108 deep-dive deliverables. Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Twin migration to adm_vulkan (T-GPU-DEDUP-21); same 16-pipeline 2-D [stage][scale] shape (4 stages * 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. The (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0122) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
16-pipeline 2-D [stage][scale] array (4 stages × 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants (every (stage, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle — the (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0121) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
…_template Twin migration to adm_vulkan (T-GPU-DEDUP-21); same 16-pipeline 2-D [stage][scale] shape (4 stages * 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. The (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0122) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
May 2, 2026
…l_template + _add_variant (#288) * refactor(vulkan): T-GPU-DEDUP-22 — migrate float_adm_vulkan to kernel_template Twin migration to adm_vulkan (T-GPU-DEDUP-21); same 16-pipeline 2-D [stage][scale] shape (4 stages * 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle. The (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0122) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(vulkan): kernel_template — raise SSBO binding cap from 8 to 16 float_adm_vulkan (T-GPU-DEDUP-22) binds 9 SSBOs (src + 2× dwt_tmp + 2× band + 2× csf + accum + dis) and was tripping the template's max-8 guard at init() time, causing every extract() call to fail with "problem reading pictures" / "problem flushing context". The new cap of 16 is purely additive: existing consumers (PSNR 3 SSBOs, moment 4, ciede 3, motion 2, ssim 6, vif 6, etc.) are unaffected. Vulkan's portability minimum for maxDescriptorSetStorageBuffers is 96 on conformant devices, so 16 is well within the safe range. Smoke: float_adm Netflix-pair (576×324×48f) now reports adm2 mean 0.934515; smoke tests + lint clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
May 2, 2026
16-pipeline 2-D [stage][scale] array (4 stages × 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants (every (stage, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle — the (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0121) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
May 2, 2026
…late + _add_variant (#287) * refactor(vulkan): T-GPU-DEDUP-21 — migrate adm_vulkan to kernel_template 16-pipeline 2-D [stage][scale] array (4 stages × 4 scales). State collapses dsl + pipeline_layout + shader + desc_pool to VmafVulkanKernelPipeline pl. The VkPipeline pipelines[4][4] 2-D lookup is preserved so the per-stage dispatch path stays clean, but pipelines[0][0] aliases s->pl.pipeline (template's base) and the other 15 entries are sibling pipelines via _add_variant(). close_fex destroys the 15 sibling variants (every (stage, scale) except (0, 0)) before calling vmaf_vulkan_kernel_pipeline_destroy() on the bundle — the (0, 0) skip is essential because pipelines[0][0] aliases s->pl.pipeline. Validated by meson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation (all green) + clean compile. Numerical contract unchanged. Based on refactor/vulkan-template-add-variant (PR #272); will rebase clean once #272 lands. CHANGELOG.md + docs/rebase-notes.md (entry 0121) updated per ADR-0108 deep-dive deliverables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(vulkan): T-GPU-DEDUP-21 — remove dead VkDescriptorPool desc_pool field Stale field left over from pre-template state struct; no longer referenced after the template owns the pool via s->pl.desc_pool. Pure dead-code removal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libvmaf/src/vulkan/kernel_template.hwithvmaf_vulkan_kernel_pipeline_add_variant()so kernels that needmultiple
VkPipelines sharing a layout / shader / DSL /descriptor pool (different spec-constant) can express that
without re-implementing the boilerplate.
motion_vulkan.c. State collapsesVkPipeline pipelines[2](kept "for SYCL parity" butfunctionally identical because COMPUTE_SAD goes through push
constants, not spec-constants) to a single
VmafVulkanKernelPipeline pl.create_pipelines/close_fexshrink to template-driven create + destroy.
ssim_vulkan.c. State becomesVmafVulkanKernelPipeline pl + VkPipeline pipeline_vert. Pass 0(horizontal) is the template's base pipeline; pass 1 (vertical)
is created via
_add_variant().Test plan
ninja -C build-vulkancleanmeson test test_vulkan_smoke test_vulkan_async_pending_fence test_vulkan_pic_preallocation— all greenvmaf --backend vulkan --feature float_ssimonsrc01_hrc00/01_576x324.yuv→ mean 0.863, 48 frames (matches pre-migration)pre-commit run --files <touched>cleanclang-tidy -p build-vulkan— net −1 warnings vs master (one fewer than baseline; no new issues introduced)Six deep-dive deliverables (ADR-0108)
no digest needed: routine refactorno alternatives: only-one-way fix(the dormantpipelines[2]collapse and_add_variant()shape were the obvious extensions of the existing template)AGENTS.mdinvariant note: the rebase-sensitive invariants live indocs/rebase-notes.mdentry 0106### ChangedTouched files lint-clean (CLAUDE.md §12 r12)
Touched-file clang-tidy on
motion_vulkan.c+ssim_vulkan.cshows -1 net warnings vs master (one fewer pre-existing, no new).
All remaining diagnostics are pre-existing items already tracked
under T7-5.
🤖 Generated with Claude Code