Skip to content

fix(python): declare init_dwt_band_d to Cython as adm.c defines it - #1881

Merged
lusoris merged 1 commit into
masterfrom
fix/ci-cython-adm-dwt-band-cursor
Oct 2, 2026
Merged

lusoris merged 1 commit into
masterfrom
fix/ci-cython-adm-dwt-band-cursor

Conversation

@lusoris

@lusoris lusoris commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

BLUF: the Python harness wheel failed to build on every hosted job that builds it, because adm_dwt2_cy.pyx declared init_dwt_band_d() with the signature adm.c had before #1859. The declaration and the call are fixed; a device-free contract test keeps them in step.

Cause

#1859 changed core/src/feature/adm.c::init_dwt_band_d() from char *init_dwt_band_d(band, char *data_top, size_t buf_sz_one) (cursor in bytes) to double *init_dwt_band_d(band, double *data_top, size_t band_len) (cursor in samples). compat/python-vmaf/core/adm_dwt2_cy.pyx text-includes adm.c, re-declares the helper, and kept the old declaration, so the generated adm_dwt2_cy.c:21871 passes char * as double *. Failing jobs: Ubuntu clang, Ubuntu ARM clang, macOS clang, macOS clang+DNN (run 37051927171, jobs 110987165105, 110987165289, 110987165189, 110987165152). The error is -Wincompatible-pointer-types as an error on clang 22 and Homebrew clang; GCC rejects it too. No warning flag is touched.

Reproduction

Before: cd python && CC=clang python setup.py build_ext (also CC=gcc):
../compat/vmaf/core/adm_dwt2_cy.c:21871:58: error: incompatible pointer types passing 'char *' to parameter of type 'double *' [-Wincompatible-pointer-types] (and :21871:20, assigning to char * from double *).
After: both compilers build vmaf.core.adm_dwt2_cy clean. The generated code is architecture-independent, so the aarch64 job fails and passes for the same reason (no qemu run).

Fix: double *data_top, data_top = data_buf, declaration double *init_dwt_band_d(adm_dwt_band_t_d *band, double *data_top, size_t band_len), call with buf_sz_one // sizeof(double) (the byte plane size to a sample count, as the C caller does).

Test: core/test/test_cython_adm_dwt_band_decl_contract.py (fast suite, no compiler, no Cython) compares the declaration with the definition and the call's length; it fails 3 of 4 cases on the old .pyx and passes 4 of 4 now.

make test-netflix-golden: 271 passed, 12 skipped.

Checklist

  • Research digest — no digest needed: a stale declaration after a signature change.
  • Decision matrix — no alternatives: only-one-way fix (the declaration must match the definition).
  • AGENTS.md invariant note — no rebase-sensitive invariants beyond the rebase note.
  • Reproducer / smoke-test command — see Reproduction.
  • CHANGELOG fragment — changelog.d/fixed/cython-adm-dwt-band-declaration.md.
  • Rebase note — docs/rebase-notes.md.
  • state.md — T-CI-MASTER-FIRST-FULL-RUN-2026-10-02, item 9.
  • User-discoverable docs — not applicable: no user-visible surface changes.
  • ADR — not applicable: bug fix.
  • Netflix golden gate — run, 271 passed, 12 skipped; no assertion touched.

@github-actions github-actions Bot added the type:bug Something isn't working label Oct 2, 2026
…1881)

* fix(python): declare init_dwt_band_d to Cython as adm.c defines it

The wheel build of the Python harness failed on every hosted job that runs
it (Ubuntu clang, Ubuntu ARM clang, macOS clang, macOS clang+DNN):
adm_dwt2_cy.c:21871 passed a char * where init_dwt_band_d() takes a double *.
PR #1859 gave adm.c's helper a sample-typed cursor and a length in samples;
adm_dwt2_cy.pyx still declared char *data_top and passed a byte count.

The declaration, the cursor and the call now use double * and
buf_sz_one // sizeof(double). test_cython_adm_dwt_band_decl_contract keeps the
declaration in step with adm.c without building the extension.
@lusoris
lusoris force-pushed the fix/ci-cython-adm-dwt-band-cursor branch from 21e63bf to bf5527a Compare October 2, 2026 21:17
@lusoris
lusoris merged commit bf5527a into master Oct 2, 2026
3 of 79 checks passed
@lusoris
lusoris deleted the fix/ci-cython-adm-dwt-band-cursor branch October 2, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant