Skip to content

vk: preserve immutable samplers during descriptor copies - #445

Draft
pablogonz12 wants to merge 1 commit into
mainfrom
lane/descriptor-copy-1201
Draft

pablogonz12 wants to merge 1 commit into
mainfrom
lane/descriptor-copy-1201

Conversation

@pablogonz12

@pablogonz12 pablogonz12 commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix copying a combined image descriptor into a binding with immutable samplers. mali_dset_copy() previously copied the whole element, replacing the destination sampler with the source sampler. It now copies only the image descriptors and keeps the destination's immutable sampler.

The image portion can contain two texture descriptors for YCbCr, so the copy length follows the destination's plane count. Mutable destination samplers still copy normally. No extension flags, compiler transformations, or driver defaults change.

Evidence

  • Before: the new t_desc regression produces 18 failing assertions against unchanged main's implementation.
  • After: vk/tests/build-t_desc.sh passes with zero failures. Fifteen configurations cover v10/v11/v13 descriptor layouts, all four ordinary mutable/immutable source/destination combinations, synthetic two-plane YCbCr descriptors, array offsets, binding gaps, untouched neighboring elements, and unchanged source data. These are host byte checks, not GPU rendering evidence.
  • vk/check.sh --no-build: OK, 280 ok rows. The optional standalone state-sweep binary is absent and its row is skipped.
  • Native build, private lint, skill lint, and progress diagram check pass.
  • ARM64 glibc-WSI driver builds from clean commit 1c65e336; SHA-256 9b46388c505cab492138eeaf9df331dd3ea0fc47b8e1fd22936569eab1d9ad8b.
  • Added explicit-only t_vk_feat --only immcopy. It samples a copied image at a coordinate where the source's repeat sampler produces blue, but the destination's immutable clamp sampler must produce red. Independent source-repeat, fresh direct-write, and in-range image controls prevent a missing copy/draw from passing. Fake-backend recording passes on v10/v11/v13; pixels are explicitly skipped there.

Additional sanitizer run

The complete MALI_SAN=1 vk/check.sh run did not pass: 244 ok rows and three failures (KCPU pending fence model, async import reader drain, and vk_trace v10). All three new immcopy fake-GPU rows passed under ASan/UBSan.

The standalone KCPU/import tests do not compile mali_descriptor.c; their input sources are unchanged from main. Both passed when rerun without the harness-wide ASan preload. The KCPU failure reports a fixed-address BO mapping collision (File exists). The trace test intentionally faults and requires SIGSEGV termination; it passed with ASan's SIGSEGV interception disabled (handle_segv=0). These observations are recorded as sanitizer-harness limitations, not as a passing full sanitizer gate or hardware evidence. No unrelated harness behavior was changed in this PR.

Hardware status

Not yet hardware-validated. X4 was reachable and passed the initial health check, but the guarded runner refused to proceed because Android Settings was foreground with the screen on. No files were staged, no application was launched, and no phone settings or installed drivers were changed. CMF was not reachable through the configured device wrapper and wireless discovery.

A bounded, hash-verified before/after regression run is prepared, followed by the guarded product smoke. Keep this draft until hardware evidence is available. No performance claim is made.

Specification

The immutable sampler contract applies to combined image descriptor updates: only image views change, while immutable sampler updates are ignored. VkCopyDescriptorSet's prohibition on immutable destinations applies to standalone SAMPLER descriptors, not COMBINED_IMAGE_SAMPLER descriptors.

Merge Danger

Door: Two-way, revertible.

Blast radius: Descriptor copying for immutable combined-image bindings, shared by the GPU architectures. Changes are confined to mali_descriptor.c and regression tests; existing overlapping driver lanes are untouched. Hardware smoke remains required before merging.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Copy link
Copy Markdown
Owner Author

Prepared an owner-only single-file AArch64 glibc immcopy probe from exact PR source 1c65e33 and the existing #460 embedded-SPIR-V generator. Native RX 9070 XT RADV actual readback: repeat and inside blue; direct and copied red; pass=true. SPIR-V validation and warning-clean builds passed. Exact baseline and candidate hashes/provenance verified, and an interleaved guarded X4 owner test request recorded. Mali pixel evidence remains pending; no device access or production driver changes in this pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant