Skip to content

fix: 9 confirmed defects from an adversarial bug hunt (ADR-0138)#37

Merged
lusoris merged 1 commit into
masterfrom
fix/bug-hunt-batch
Jun 27, 2026
Merged

fix: 9 confirmed defects from an adversarial bug hunt (ADR-0138)#37
lusoris merged 1 commit into
masterfrom
fix/bug-hunt-batch

Conversation

@lusoris

@lusoris lusoris commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What

Fixes 9 confirmed defects found by an adversarially-verified bug hunt (5 dimension-finders → 15 candidates → independent source verification → 9 confirmed). ADR-0138.

Two must-fix (fire on default configs)

  • denoise unbound descriptor at default meta=0stat_buffer (binding 5) is statically referenced by the SPIR-V but was bound only inside if(want_meta); on the default path a used storage descriptor was left unbound → invalid Vulkan (validation error / UB / device-lost on strict drivers; the dev-box NVIDIA driver tolerated it, masking the bug). Now always allocated + bound (mirroring mv/conf 6/7); zero-fill/readback stay gated on want_meta.
  • denoise uninitialized exec read on an early-fail path → = NULL.

Six should-fix (hardenings)

defect fix
mc s_part[128] OOB on subgroupSize<8 size to BLOCK_DIM*BLOCK_DIM (lockstep .comp)
interop pel_blob_pack uint32 size overflow → heap overflow 64-bit accumulate, reject >UINT32_MAX (PEL_ERR_RANGE)
interop pel_blob_find_section missing R5 alignment reject (off&7) (PEL_ERR_ABI)
denoise MC-consumer gc*gr signed overflow (untrusted) uint64 + PEL_DENOISE_MAX_CELLS cap
mc av_realloc on libc-calloc'd blob (cross-allocator UB) libc realloc
analyze coalesce_roi drops ROI by raster pos, not score collect all runs, sort by banding strength, keep top max

Validation

Interop conformance fixture extended (test_misaligned_offsetPEL_ERR_ABI, test_pack_size_overflowPEL_ERR_RANGE). meson test --suite=fast 11/11; full n8.1.1 patch-stack apply + make ffmpeg clean; GPU smokes on vk:0 all pass — incl. denoise at default meta=0 (the must-fix path), mc, analyze-roi, denoise meta=1, denoise mc=1.

Interop fixes are defensive parser hardenings — no wire-ABI change (append-only safe; vmafx picks them up on its next interop.c sync). Regenerates patches 0002/0003/0007.

🤖 Generated with Claude Code

A verified sweep (5 finders -> 15 candidates -> 9 confirmed after independent
source verification) across the filter family, GPU dispatch lifecycle, interop
ABI, and patch stack. Two fire on DEFAULT configs.

must-fix:
- denoise: stat_buffer (binding 5) statically referenced by the shader but bound
  only inside if(want_meta); on the DEFAULT meta=0 path it was left unbound ->
  invalid Vulkan usage (validation error / UB / device-lost on strict drivers;
  tolerated on the dev-box NVIDIA driver, masking it). Now always allocated +
  bound every dispatch (mirroring mv/conf); zero-fill/readback still gated on meta.
- denoise: uninitialized FFVkExecContext *exec read on an early-RET fail path.

should-fix:
- mc: s_part[128] OOB on subgroupSize<8 -> size to BLOCK_DIM*BLOCK_DIM, lockstep.
- interop pel_blob_pack: uint32 total_size overflow -> heap overflow -> uint64 +
  reject > UINT32_MAX with PEL_ERR_RANGE.
- denoise MC consumer: cells = grid_cols*grid_rows signed overflow -> uint64 + cap.
- interop pel_blob_find_section: missing R5 8-byte alignment check -> PEL_ERR_ABI.
- mc: av_realloc on a libc-calloc'd blob (cross-allocator UB) -> libc realloc.
- analyze coalesce_roi: dropped ROI by raster position, not score -> sort by
  banding strength, keep top max.

Interop conformance fixture extended. No wire-ABI change. meson fast 11/11; full
n8.1.1 patch-stack build clean; GPU smokes pass incl. denoise meta=0. Regenerates
patches 0002/0003/0007.

ADR: docs/adr/0138-bug-hunt-remediation.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lusoris
lusoris merged commit e52da3f into master Jun 27, 2026
3 checks passed
@lusoris
lusoris deleted the fix/bug-hunt-batch branch June 27, 2026 15:00
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