Skip to content

fix: restore AI CLI helpers and align mypy pre-push gate - #1552

Merged
lusoris merged 8 commits into
train/pre-rc1-correctness-20260924from
fix/mypy-prepush-config-baseline-rc1
Sep 25, 2026
Merged

lusoris merged 8 commits into
train/pre-rc1-correctness-20260924from
fix/mypy-prepush-config-baseline-rc1

Conversation

@lusoris

@lusoris lusoris commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the fail-closed pre-push mypy delta gate so branch and merge-base sources
are evaluated under the same checker configuration, with canonical module
identity and blocker-status handling. It also restores the accepted
ADR-0680/0681 shared bootstrap, parser, and replay-argv contract across twelve
current tiny-AI evaluation, quantization, and export scripts, guarded by an AST
red-cap and direct-file/module probes.

This closes
T-CI-MYPY-PREPUSH-BASELINE-USES-BASE-CONFIG-2026-09-21 and the BUG-048
AI-CLI helper cluster. BUG-048 itself remains open for its other independent
restoration sections.

Commit d170ef86a silently replaced the already-accepted shared CLI/bootstrap
helpers with hand-rolled path, parser, and argv handling. This PR selectively
restores ADR-0680/0681 behavior while preserving every later functional CLI
and provenance change; it does not roll back the training scaffold.

Type

  • fix — bug fix
  • build / ci — tooling / infra
  • feat — new feature
  • perf — performance improvement
  • refactor — no behavior change
  • docs — documentation only
  • test — test-only
  • port — cherry-pick from upstream Netflix/vmaf
  • sycl / cuda / simd — backend-specific

Checklist

  • All commits follow Conventional Commits and carry verified signatures.
  • Black, Ruff, changed-file pre-commit, HISS, make verify-all, and the
    normal pre-push gates are green.
  • Mypy hook contract tests pass: 32/32.
  • Exact focused AI reviewer set passes: 46/46.
  • Complete ai/ package passes: 1,327 passed, 1 skipped.
  • All 29 scanner-visible touched files are clean.
  • No SIMD/GPU code path, feature extractor, or native file was changed.
  • This is not a breaking change.

Bug-status hygiene

  • docs/state.md closes both scoped rows with executable evidence and
    explicitly keeps the wider BUG-048 restoration effort open.

Netflix golden-data gate

  • No Netflix golden assertion or test data was modified.
  • No golden-value exception is requested.

Local validation

Mypy gate repair

  • python3 scripts/git-hooks/test-pre-push-mypy.py: 32 passed
  • Real post-stack pre-push mypy gate: 0 introduced, 601 inherited
  • Configuration/blocker regressions: 13 focused cases green

AI CLI/bootstrap restoration

  • Semantic restoration red-cap: 12 passed
  • Focused helper/provenance/QAT/PTQ/exporter set: 46 passed
  • Python 3.14-safe dynamic loader contract: 12 passed
  • Direct-file plus python -m --help: 24/24 passed
  • Complete ai/ package: 1,327 passed, 1 skipped
  • Black 26.5.1 and Ruff 0.16.8: clean

Repository gates

  • make verify-all: passed, HISS 264 within the 276 baseline and all 29
    scanner-visible touched files clean
  • Normal pre-push gates: passed, including strict MkDocs, security, HISS,
    dedupe, formatting, mypy, and PR-body governance
  • Writable AGY normal-mode review found and fixed seven introduced mypy
    findings before publication

Deep-dive deliverables

  • Research digest —
    docs/research/2092-mypy-pre-push-config-baseline.md and
    docs/research/2088-bug048-ai-cli-helper-restoration.md.
  • Decision matrix — both digests document the only-way correctness
    repairs and rejected suppression, whole-commit replay, and global
    bootstrap-widening alternatives.
  • AGENTS.md invariant note — scripts/AGENTS.md pins checker config,
    scope, canonical module identity, and fail-closed status handling;
    ai/AGENTS.md pins the twelve-script helper and Python 3.14 loader contracts.
  • Reproducer / smoke-test command — pasted below under Reproducer.
  • CHANGELOG fragment —
    changelog.d/fixed/pre-push-mypy-config-baseline.md and
    changelog.d/fixed/bug048-ai-cli-helper-restoration.md.
  • Rebase note — docs/rebase-notes.md records both invariant groups.

Reproducer

python3 scripts/git-hooks/test-pre-push-mypy.py
PRE_COMMIT_TO_REF="$(git rev-parse HEAD)" python3 scripts/git-hooks/pre-push-mypy.py
python3 -m pytest \
  ai/tests/test_ai_cli_helper_restoration.py \
  ai/tests/test_eval_report_run_provenance.py \
  ai/tests/test_legacy_eval_report_run_provenance.py \
  ai/tests/test_qat_smoke.py \
  ai/tests/test_ptq_scripts.py \
  ai/tests/test_ptq_cli_contracts.py \
  ai/tests/test_measure_quant_drop_per_ep.py \
  ai/tests/test_dnn_exporter_run_provenance.py -q

Expected: 32 hook tests, no branch-introduced mypy findings, and 46 affected AI
tests pass.

Known follow-ups

  • The separate hosted Python Lint job remains advisory and lacks a pinned
    dependency-rich type-check environment; that existing item remains tracked
    as T-CI-MYPY-JOB-CHECKS-NO-FILES-2026-09-21.
  • BUG-048 remains open for its other independently reviewed restoration chunks.
  • Benchmarking, performance tuning, model work, and retraining remain out of
    scope until correctness and security cleanup completes.
  • Integration receipt: stacked PR fix(ai): restore shared CLI helper contracts #1553 was ordinarily squash-merged into this
    branch as commit 862e1b08d; no admin bypass was used.

@lusoris
lusoris enabled auto-merge (squash) September 24, 2026 11:14
@github-actions github-actions Bot added the type:bug Something isn't working label Sep 24, 2026
@lusoris lusoris mentioned this pull request Sep 24, 2026
11 of 26 tasks
Co-authored-by: Lusoris <lusoris@pm.me>
@lusoris lusoris changed the title fix(hooks): align mypy baseline configuration fix: restore AI CLI helpers and align mypy pre-push gate Sep 24, 2026
- Annotate SCRIPT_PATH: Path and REPO_ROOT: Path in measure_quant_drop.py,
  ptq_dynamic.py, and ptq_static.py matching ADR-0681 conventions to reconcile
  silent-revert gate detection against d170ef8 without allowlisting.
- Add focused regression coverage in test_ptq_cli_contracts.py for CLI help,
  import isolation, and argv handling contracts across PTQ and quantization scripts.
@lusoris
lusoris disabled auto-merge September 24, 2026 20:13
@lusoris
lusoris changed the base branch from master to train/pre-rc1-correctness-20260924 September 24, 2026 20:14
@lusoris
lusoris merged commit 677232d into train/pre-rc1-correctness-20260924 Sep 25, 2026
1 check passed
lusoris added a commit that referenced this pull request Sep 25, 2026
…ec A11)

Restores the non-numeric column filter in ai/scripts/feature_correlation.py
that was originally landed in commit 5fc7391 (#1552) and silently reverted
in 384d97d.

When processing parquets containing non-numeric columns (e.g. string metadata
columns such as 'codec' or 'chug_orientation'), calling
.to_numpy(dtype=np.float64) on candidate columns caused a runtime crash
with ValueError: could not convert string to float.

- ai/scripts/feature_correlation.py: filter candidate_cols using
  select_dtypes(include="number") before calling to_numpy(dtype=np.float64),
  and log any skipped non-numeric columns.
- ai/tests/test_feature_correlation.py: add deterministic regression test
  test_corr_main_skips_non_numeric_columns verifying that string and
  metadata columns are skipped without crashing, omitted from the JSON
  report and Pearson keys, and that numeric features are retained.
- docs/rebase-notes.md, docs/state.md, changelog.d/: record restoration of
  BUG-048 item A11 and update bug tracking state.
@lusoris
lusoris deleted the fix/mypy-prepush-config-baseline-rc1 branch September 25, 2026 14:52
lusoris pushed a commit that referenced this pull request Oct 5, 2026
… defects on the known-upstream page

The known-upstream page listed #1562 only. It now has a dated section for
the GPU reports checked on 2026-10-05:

- #1566 (fixed upstream by #1552): the CUDA motion kernel above 8 bits
  advanced a 16-bit pointer by the byte stride. Not affected: the fork's
  SAD kernel reads a row through a byte pointer (load_sample()), equal to
  the CPU in test_cuda_exact_twins, test_cuda_motion_tiny_frames and the
  depth and layout matrix; the planted upstream form fails above 8 bits and
  gives 26993 invalid reads under compute-sanitizer memcheck.
- #1564 bugs 1 to 3 (CUDA masking border rows, per-warp rounding, x86 DWT
  last column) and its follow-ups: were affected, fixed, with the code and
  tests that hold each fix.

docs/state.md records #1566 under "Confirmed not-affected".
lusoris pushed a commit to Tualua/vmafx that referenced this pull request Oct 6, 2026
… defects on the known-upstream page (VMAFx#2178)

* docs(upstream): record the CUDA 16-bit row-stride and integer ADM GPU defects on the known-upstream page

The known-upstream page listed VMAFx#1562 only. It now has a dated section for
the GPU reports checked on 2026-10-05:

- VMAFx#1566 (fixed upstream by VMAFx#1552): the CUDA motion kernel above 8 bits
  advanced a 16-bit pointer by the byte stride. Not affected: the fork's
  SAD kernel reads a row through a byte pointer (load_sample()), equal to
  the CPU in test_cuda_exact_twins, test_cuda_motion_tiny_frames and the
  depth and layout matrix; the planted upstream form fails above 8 bits and
  gives 26993 invalid reads under compute-sanitizer memcheck.
- VMAFx#1564 bugs 1 to 3 (CUDA masking border rows, per-warp rounding, x86 DWT
  last column) and its follow-ups: were affected, fixed, with the code and
  tests that hold each fix.

docs/state.md records VMAFx#1566 under "Confirmed not-affected".
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