Skip to content

docs(state): close the stale Metal motion_v2 mirror off-by-one row - #1330

Closed
lusoris wants to merge 2 commits into
masterfrom
docs/close-t-metal-motion-v2-mirror-off-by-one-2026
Closed

lusoris wants to merge 2 commits into
masterfrom
docs/close-t-metal-motion-v2-mirror-off-by-one-2026

Conversation

@lusoris

@lusoris lusoris commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

T-METAL-MOTION-V2-MIRROR-OFF-BY-ONE-2026-09-03 was still listed under "Open bugs" in docs/state.md, but the defect it describes was fixed on master a day after the row was written. This PR corrects the ledger (moves the row to "Recently closed" with the verification recorded) and rewrites the one stale artefact the fix left behind: the top-of-file block comment in core/src/feature/metal/integer_motion_v2.metal, which still described the removed mirror convention and contradicted the corrected mv2_mirror comment directly below it. No Metal code path reads the comment; scores, snapshots and the Netflix golden gate are untouched.

Verification that the bug is not open

The row claimed the Metal fold used 2 * sup - idx - 1 (which repeats the boundary row) while the scalar core/src/feature/integer_motion_v2.c:157 and the CUDA twin use reflect-101 2 * size - idx - 2. At origin/master the helper is:

inline int mv2_mirror(int idx, int sup)
{
    if (sup <= 1) return 0;
    while (idx < 0 || idx >= sup)
        idx = (idx < 0) ? -idx : 2 * (sup - 1) - idx;
    return idx;
}

2 * (sup - 1) - idx is algebraically identical to the CPU's 2 * size - idx - 2, so the convention already matches, and the iterated fold additionally removes the single-bounce out-of-range read on small dimensions. git log --oneline origin/master -- core/src/feature/metal/integer_motion_v2.metal shows the change landed in 71da046db — "fix(core): harvest and fix nine stale upstream Netflix/vmaf reports (ADR-1166)" (PR #1223, 2026-09-04). The ledger row was written 2026-09-03 and never updated.

The remaining Apple-hardware /cross-backend-diff places=4 confirmation is owner-driven and is tracked by the standing Metal validation gaps, not by this numeric-parity row.

Type

  • docs — documentation only

Checklist

  • Commits follow Conventional Commits (the commit-msg hook enforces this).
  • pre-commit run --files <touched> is green locally (no compiled surface changed; the only C-family edit is a block comment).
  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Bug-status hygiene (ADR-0165)

  • docs/state.md updated in this PR — the row is moved (not copied) from "Open bugs" to "Recently closed", leaving exactly one row for the bug id, with the closing commit 71da046db cited.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: trivial change, a ledger correction plus a stale comment rewrite.
  • Decision matrix — no alternatives: only-one-way fix; the row records what master already does.
  • AGENTS.md invariant note — no rebase-sensitive invariants.
  • Reproducer / smoke-test command — pasted below under "Reproducer".
  • CHANGELOG fragment — changelog.d/fixed/metal-motion-v2-mirror-header-comment.md; CHANGELOG.md re-rendered by scripts/release/concat-changelog-fragments.sh --write.
  • Rebase note — no rebase impact: ledger row plus a fork-local Metal block comment; no upstream-adjacent code changed.

Reproducer

# 1. The reported defect is absent on master — the Metal fold is the CPU form:
git show origin/master:core/src/feature/metal/integer_motion_v2.metal | sed -n '/mv2_mirror/,/^}/p'
git show origin/master:core/src/feature/integer_motion_v2.c | grep -n '2 \* size - idx - 2'

# 2. The ledger now carries exactly one row for the id, in Recently closed:
grep -n 'T-METAL-MOTION-V2-MIRROR-OFF-BY-ONE-2026-09-03' docs/state.md

# 3. Rendered changelog matches the fragment tree:
bash scripts/release/concat-changelog-fragments.sh --write && git diff --exit-code CHANGELOG.md

Known follow-ups

  • Apple-Silicon /cross-backend-diff (places=4) for every Metal extractor remains outstanding; it is a hardware-access gap, not a known defect.

T-METAL-MOTION-V2-MIRROR-OFF-BY-ONE-2026-09-03 was filed on
2026-09-03 against `core/src/feature/metal/integer_motion_v2.metal`
for folding the high boundary with `2 * sup - idx - 1` instead of the
scalar reflect-101 `2 * size - idx - 2`. The defect was fixed one day
later by 71da046 (PR #1223, ADR-1166), which replaced the helper
with the iterated fold `2 * (sup - 1) - idx` -- algebraically the CPU
form -- and thereby also removed the residual out-of-range
single-bounce read on small dimensions. The ledger row was never
updated, so the bug read as open on master.

Move the row from 'Open bugs' to 'Recently closed' (exactly one row
per bug id) with the verification recorded, and rewrite the file's
top-of-file block comment, which still described the removed `- 1`
convention and contradicted the corrected `mv2_mirror` comment below
it. No code path reads the comment; scores, snapshots and the Netflix
golden gate are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lusoris lusoris added this to the 1.0.0 — First release milestone Sep 5, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lusoris

lusoris commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1294, which covers the same bug more completely.

Both close T-METAL-MOTION-V2-MIRROR-OFF-BY-ONE-2026-09-03. This PR corrects the ledger only; #1294 additionally fixes the stale file-header comment that still described the pre-#1223 indexing and adds the test observability that makes the parity assertion meaningful. Keeping both would put two rows for one bug id into docs/state.md, which scripts/ci/check-state-md-rows.sh now rejects.

Closing this one; #1294 carries the fix.

@lusoris lusoris closed this Sep 6, 2026
@lusoris
lusoris deleted the docs/close-t-metal-motion-v2-mirror-off-by-one-2026 branch September 18, 2026 07:57
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