Skip to content

docs: repair the ADR-to-ADR citations the link gate could not see - #1524

Merged
lusoris merged 2 commits into
masterfrom
fix/adr-sibling-links
Sep 23, 2026
Merged

lusoris merged 2 commits into
masterfrom
fix/adr-sibling-links

Conversation

@lusoris

@lusoris lusoris commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

#1522 shipped a gate for adr/NNNN-slug.md links and reported the tree clean.
It was clean only of the spelling it matched. An ADR cites a sibling as
(0530-slug.md), and one under docs/adr/by-tag/ as (../0530-slug.md) —
neither carries the adr/ segment the pattern required, so 237 broken
sibling links were invisible to it
. Making the segment optional finds them;
admitting the bare form only for files under docs/adr/ keeps docs/research/,
which names its digests NNNN-slug.md too, from being read as broken ADR
citations.

The more important finding is what repairing them by number would have done.
Inside docs/adr/ the population inverts: 196 of the 237 carry a slug that
names no ADR at all, leaving only the number — and for 56 of those the number
had been reallocated by the collision sweeps. Repairing from the number would
have pointed [ADR-0033](0033-hip-applicability.md), cited in ADR-0315 as the
precedent for fork-side GPU ports, at 0033-codeql-config-moved-to-github.md,
and [ADR-0009](0009-batch-a-upstream-port-strategy.md), cited there as the
fork's demand-pull pattern, at the MCP server tool surface. That is the failure
#1522 exists to prevent, arriving from the other direction: it resolves, reads
as authoritative, and is worse than the dead link it replaced.

So a by-number repair now has to be corroborated by the target's own title and
abstract
, and the corroboration weighs the words that identify a decision over
the words a whole family shares. The measurement that forces that weighting:
[ADR-0138 — PSNR-HVS SIMD bit-exactness] cited 0138-psnr-hvs-simd-bitexact,
and 0138-iqa-convolve-avx2-bitexact-double does say "simd" and "bitexact" — it
is a sibling in that family, not the same decision, and says nothing about
PSNR-HVS. Counting shared words admits it; ranking hvs (3 ADRs) above simd
does not.

A third rule resolves a reordered slug from the slug half:
0335-sycl-adaptivecpp-second-toolchain is
0407-adaptivecpp-second-sycl-toolchain with two words swapped, and 0335 now
belongs to an ADR about hardware capability priors.

What was repaired

181 mechanically — 35 by exact slug, 2 by reordered slug, 144 by
corroborated number.

56 by hand, split:

  • 26 repaired against evidence. Some from the target's own text (ADR-0164
    discusses the EOTF and cbrt LUT the citation names; ADR-0269 carries the
    barrier pattern; ADR-0161 is the only ADR that discusses the SSIMULACRA 2 IIR
    blur). Some from git log: 0371-cambi-sycl-port.md is now
    0415-cambi-sycl-port.md and 0199-tiny-ai-netflix-training-corpus.md is now
    0242-…, so those citations named the right decision before it moved.
  • 30 de-linked, because the cited ADR was never written under any number and
    the number now belongs to something else. The visible text is kept exactly, so
    the rendered prose is unchanged and only the hyperlink goes. Two were left
    de-linked rather than guessed: ADR-0509 in ADR-0542, because that file already
    cites ADR-0514 on the next line so the author meant a second ADR; and the
    PSNR-HVS citation in ADR-0918, because 0159 (AVX2) and 0160 (NEON) both carry
    the FP_CONTRACT pragma and the citation does not say which.

Type

  • docs — documentation only

Checklist

  • Commits follow Conventional Commits (the commit-msg hook enforces this).
  • make format && make lint is green locally.
  • Unit tests pass: meson test -C build. — n/a for a docs + scripts/ci/ change; the checker's own suite is green (24 tests).
  • If I touched any SIMD/GPU code path, I ran /cross-backend-diff and the worst ULP is ≤ 2. — n/a, no code path touched.
  • If I touched a feature extractor with SIMD/GPU twins, I either updated every twin or listed the gap under "Known follow-ups" below. — n/a.
  • If I added a new .c / .cpp / .cu / .h / .hpp, it has the appropriate license header (see CONTRIBUTING.md). — n/a, no new source file.
  • If this is a breaking change, the commit message uses ! or BREAKING CHANGE: and the migration path is documented below. — not breaking.
  • If this PR adds an ADR, the ADR row lives in docs/adr/_index_fragments/<NNNN-slug>.md. — no ADR added; this implements the gate ADR-0221 and ADR-0386 already require.

Bug-status hygiene (ADR-0165)

  • docs/state.md updated in this PR with a row —
    T-DOCS-ADR-SIBLING-LINK-DRIFT-2026-09-23, closed, recording the measurement,
    the fifteen ADR numbers cited for decisions nobody wrote, and what the gate
    still does not check.

Netflix golden-data gate (ADR-0024)

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: the measurement is reproducible
    from the checker itself (the command below prints the same counts) and is
    recorded in the module docstring and the docs/state.md row.
  • Decision matrix — no alternatives: only-one-way fix. The gate either
    sees the sibling spelling or it does not; the one real choice — whether to
    auto-apply an uncorroborated by-number repair — is settled by the 56 measured
    mislinks and written up in the docstring.
  • AGENTS.md invariant note — no rebase-sensitive invariants: this
    touches docs/ prose and one scripts/ci/ checker, neither upstream-mirrored.
  • Reproducer / smoke-test command — below.
  • CHANGELOG fragment — changelog.d/fixed/adr-sibling-link-repair.md.
  • Rebase note — no rebase impact: fork-local documentation and a fork-local CI script; no upstream-mirrored file is touched.

Reproducer

# The gate, on this branch:
python3 scripts/ci/check-adr-links.py
#   -> check-adr-links: OK (1017 ADR numbers, every ADR link under docs resolves)

# The same gate on master still reports clean, because it cannot see the form:
git stash && git checkout master -- scripts/ci/check-adr-links.py
python3 scripts/ci/check-adr-links.py   # -> OK, on a tree with 237 broken links

# Positive, negative and boundary coverage (HISS-15), 16 tests -> 24:
python3 -m pytest scripts/ci/tests/test_check_adr_links.py -q

# Docs gates that read the same tree:
bash scripts/docs/concat-adr-index.sh --check
bash scripts/docs/generate-adr-nav.sh --check
bash scripts/docs/generate-adr-by-tag.sh --check
npx markdownlint-cli2 $(git diff --name-only origin/master -- 'docs/**/*.md')

Known follow-ups

  • Fifteen ADR numbers are cited for decisions nobody wrote — ADR-0009,
    0026, 0033, 0040, 0122, 0125, 0127, 0287, 0358, 0379, 0460, 0568, 0864, 0867,
    0979. Several were cited as "in-flight" and never landed; their numbers now
    belong to other decisions. Their citations are plain text here. Writing them,
    or recording them as abandoned, is a separate job.
  • A citation where both halves agree and both name the wrong decision is
    still unchecked by any gate. That needs review, not a parser — tracked as
    T-STALE-ADR-CITATIONS-2026-09-16.

@github-actions github-actions Bot added the type:docs Documentation updates label Sep 23, 2026
clean. It was clean only of the spelling it matched: an ADR cites a
sibling as `(0530-slug.md)`, with no `adr/` segment, and one under
`docs/adr/by-tag/` as `(../0530-slug.md)`. 237 of those resolved to no
file. Making the segment optional finds them; admitting the bare form
only for files under `docs/adr/` keeps `docs/research/`, which names its
digests `NNNN-slug.md` too, from being read as broken ADR citations.

The population inverts inside `docs/adr/`. For the qualified links the
slug was usually the surviving half; here 196 of 237 carry a slug that
names no ADR at all, leaving only the number -- and for 56 of those the
number had been reallocated by the collision sweeps. Repairing them from
the number would have pointed
`[ADR-0033](0033-hip-applicability.md)`, cited in ADR-0315 as the
precedent for fork-side GPU ports, at `codeql-config-moved-to-github`,
and `[ADR-0009](0009-batch-a-upstream-port-strategy.md)`, cited there as
the fork's demand-pull pattern, at the MCP server tool surface. That is
the failure #1522 exists to prevent, arriving from the other direction.

So a by-number repair now has to be corroborated by the target's own
title and abstract, and the corroboration weighs the words that identify
a decision over the words a family shares. The measurement that forces
that weighting: `[ADR-0138 -- PSNR-HVS SIMD bit-exactness]` cited
`0138-psnr-hvs-simd-bitexact`, and `0138-iqa-convolve-avx2-bitexact-double`
does say "simd" and "bitexact" -- it is a sibling in that family, not the
same decision, and it says nothing about PSNR-HVS. Counting shared words
admits it; ranking `hvs` (3 ADRs) above `simd` does not. A third rule
resolves a reordered slug from the slug half:
`0335-sycl-adaptivecpp-second-toolchain` is
`0407-adaptivecpp-second-sycl-toolchain` with two words swapped, and 0335
now belongs to an ADR about hardware capability priors.

181 links were repaired mechanically -- 35 by exact slug, 2 by reordered
slug, 144 by corroborated number -- and 56 by hand:

  * 26 repaired against evidence. Some from the target's own text
    (ADR-0164 discusses the EOTF and cbrt LUT the citation names; ADR-0269
    carries the barrier pattern; ADR-0161 is the only ADR that discusses
    the SSIMULACRA2 IIR blur). Some from `git log`: `0371-cambi-sycl-port.md`
    is now `0415-cambi-sycl-port.md`, and `0199-tiny-ai-netflix-training-corpus.md`
    is now `0242-...`, so those citations named the right decision before it
    moved.

  * 30 de-linked, because the cited ADR was never written under any
    number and the number now belongs to something else. The visible text
    is kept exactly, so the rendered prose is unchanged and only the
    hyperlink goes. ADR-0864, ADR-0867 and ADR-0979 are the clearest
    case: all three are cited as in-flight or proposed, and none landed.
    Two more were left de-linked rather than guessed -- ADR-0509 in
    ADR-0542, because that file already cites ADR-0514 on the next line,
    so the author meant a second ADR; and the PSNR-HVS citation in
    ADR-0918, because 0159 (AVX2) and 0160 (NEON) both carry the
    FP_CONTRACT pragma and the citation does not say which.

Tests go from 16 to 24, covering the sibling form from both `docs/adr/`
and its subdirectory, the research-digest exclusion, corroborated and
uncorroborated number repairs, the filler-word floor, and reordered
slugs beating both the number and each other.

Two pre-existing MD013 violations in `0691-vmafx-drop-legacy-build-paths.md`
and `0646-dnn-attached-multi-output.md` are wrapped: the files are touched
here, and ADR-0141 makes a touched file lint-clean.

Not fixed here, and recorded in `docs/state.md`: fifteen ADR numbers are
cited for decisions nobody wrote. Writing them, or recording them as
abandoned, is a separate job. Still unchecked by any gate: a citation
where both halves agree and both name the wrong decision.
@lusoris
lusoris force-pushed the fix/adr-sibling-links branch from 31ce609 to e7c2cb1 Compare September 23, 2026 11:56
#1524 left 30 citation sites as plain text on the finding that the cited
ADR "was never written under any number". That finding was reached from
the two halves of the filename -- a slug naming no ADR, a number naming
an unrelated one -- and from a text match against the ADR that carries
the number today. Both are too shallow, and 12 of the 30 were wrong.

Searching the git history of the CITING commit settles what the filename
cannot. ADR-0122 is the sharpest case and it was in this branch's own
"never written" list: the citing sentence reads "fork PR #60 CUDA
framesync hardening", and `d3b6fad62` is both PR #60 and the commit that
created `0122-cuda-gencode-coverage-and-init-hardening.md`. The number
was never reallocated. The slug had been minted from a docs/state.md
bug-row label ("CUDA framesync segfault on null cubin"), and the ADR
itself never uses the word "framesync" -- which is exactly why grepping
the target for the slug's words dismissed it.

Relinked, each from evidence rather than from either half of the name:

  * ADR-0122 x3 -> 0122-cuda-gencode-coverage-and-init-hardening.md
    (0156 x2, 0157). Number right, slug minted from a bug-row label.
  * ADR-0287 x2 -> 0293-vmaf-tune-saliency-aware.md (0326). The ADR is
    titled "vmaf-tune saliency-aware ROI tuning"; the citation calls it
    "saliency-aware encoding".
  * ADR-0568 -> 0569-sdk-version-bumps-2026-05-18.md (0603). The minted
    slug was `sdk-audit-2026-05-18` and the ADR's own title carries that
    date; it names ORT 1.26.0, vvenc and AMF seven times, which is what
    the citing sentence says it introduced.
  * ADR-0509 x2 -> 0514-dev-container-full-backend-exposure.md (0541,
    0542). It is the only ADR that discusses unsetting VK_ICD_FILENAMES
    in the entrypoint, with 13 mentions. 0542 now cites 0514 twice, for
    two different aspects; that is redundant but true, which beats a
    dangling reference.
  * ADR-0125 -> 0127-vulkan-compute-backend.md (0216). The citation
    reads "<X> / ADR-0175 -- Vulkan backend framework"; ADR-0175 opens
    by naming ADR-0127 as the decision it implements, and ADR-0127 is
    the sole owner of Research-0004, the digest the sentence says
    already covers these patterns.
  * ADR-0125 -> 0125-ms-ssim-decimate-simd.md (0219). Same list shape as
    ADR-0918's, where the same number is used correctly for the same
    ADR. Number right, slug fabricated.
  * ADR-0138 -> 0138-iqa-convolve-avx2-bitexact-double.md (0584).
  * ADR-0138 -> 0159-psnr-hvs-avx2-bitexact.md (0918), keeping the
    descriptive label. 0160 is the NEON sibling and the citation does
    not disambiguate, but that harness is x86 by 4 mentions to 1.

Nine citations stay plain text on purpose: their decision exists only in
a commit message, a PR title or a docs/state.md row, and there is no ADR
to point at -- linking them would invent an authority. ADR-0864 stays
plain for a different reason: ADR-0980 explicitly distinguishes it from
ADR-0866, so repointing there would erase the distinction the citing ADR
is drawing.

Found on the way and NOT fixed, because it is prose rather than a link:
0156-cuda-graceful-error-propagation-netflix-1420.md:215 credits the
`is_cudastate_empty()` null-guards to ADR-0122 / ADR-0123, but those
guards are upstream (b9309779f, 3071d7e) and are in no fork PR.
@lusoris
lusoris merged commit 961662b into master Sep 23, 2026
81 checks passed
@lusoris
lusoris deleted the fix/adr-sibling-links branch September 23, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant