Skip to content

Nothing catches a prose reference to a source file that no longer exists #1248

Closed

Description

@vyncint

Filing the check you invited in the #1197 review ("if you still want to file that broken-path-check issue you offered, go for it").

The rot

#1190 split several large files into module directories. Three places in the tree kept pointing at paths that no longer existed, and following any of them landed nowhere. #1197 fixed those three; the commit you stacked on it fixed 14 more in the crate-relative and bare-basename spellings.

Nothing catches this. A path in prose is not compiled, check-host-api-paths.sh checks Rust API paths rather than files, and the book gate only builds. The reference simply goes quiet, which is the bad direction — a reader follows it and finds nothing, and the tree carries no signal.

Proposed scope, deliberately narrow

A path claim is only unambiguous when it is anchored at a repo root, so the check covers exactly that: crates/, cuda-oxide-book/, scripts/ and docs/, with a file extension, appearing in prose — any line of a tracked .md, and /// or //! lines in a tracked .rs.

Measured on 26754ae5: 72 such paths, 0 broken. So it is green today and costs nothing to adopt.

The historical control is the part that makes it worth having. Run against 6f5f538a^, the commit before #1197 landed, it reports exactly the three references that PR was filed for:

crates/cuda-oxide-codegen/tests/spine_kernel_ptx.rs:21: crates/mir-lower/src/convert/types.rs
crates/rustc-codegen-cuda/examples/ref_index_projections/README.md:133: crates/mir-importer/src/translator/rvalue.rs
crates/rustc-codegen-cuda/examples/subslice_projection/README.md:10: crates/mir-importer/src/translator/rvalue.rs

What is deliberately left out, and why

Three things, each because including them is where this kind of guard goes soft:

  • Code, not prose. Restricting to markdown and doc comments is what removes the need for an allowlist. The four non-existent paths that live in Rust code are all deliberate — synthetic fixture names (intrinsics/probes/removed.ll, intrinsics/overlay/test.toml) and two paths that cuda-intrinsics-gen render tests assert are absent — and so is the mktemp canary in check-reserved-prefixes.sh. None of them is prose, so none of them needs an exemption entry.
  • intrinsics/ as a root. It is both a real top-level directory and a common crate-relative fragment. examples/atomics/README.md names intrinsics/atomic.rs in a pipeline diagram, meaning mir-importer/src/translator/terminator/intrinsics/atomic.rs, which resolves fine as shorthand. Treating intrinsics/ as a root turns that correct line into a false positive, so it is not a root.
  • The crate-relative and bare-basename spellings, which is the real coverage gap and worth stating plainly: your docs: repoint the three source references the module split invalidated #1197 commit fixed 14 references in those forms and this check would not have found them. Disambiguating rvalue.rs from prose is guesswork, and a guard that guesses is worse than one that is narrow. Full-path is how a new reference is normally written, so this covers the common case precisely rather than the whole case vaguely.

I have this working and will open a PR, with the two controls above plus a mktemp canary in the same shape as check-spdx-headers.sh.

Activity

  1. added
    documentationImprovements or additions to documentation
    testsAdds or improves test coverage
    on Sep 15, 2026
  2. nihalpasham commented on Sep 15, 2026

    @nihalpasham
    Collaborator

    Reviewed #1250: partial; the source/output distinction needs revision.

    • The guard catches a missing file when its parent survives.
    • Deleting or mistyping the parent makes the same kind of broken source reference silently pass.
    • Require explicit generated-output handling, repository-path boundaries and controls for local untracked files.
    missing source directory != proof of generated output
    

    Keeping this issue open.

  3. nihalpasham commented on Sep 18, 2026

    @nihalpasham
    Collaborator

    I rechecked #1250. Missing parents and untracked files now receive the tracked-path check, and I added a regression for compact Markdown references such as [source]:crates/pkg/lib.rs.

    The scanner controls and historical broken-path example pass locally. Hosted CI also passes on this head.

    This remains partial: the guard covers crates/, cuda-oxide-book/ and scripts/; the requested docs/ root is still outside its coverage.

  4. added
    cuda-oxideSIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, book
    on Oct 29, 2026
  5. added a commit that references this issue on Nov 3, 2026
    f1528a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-relatedBuild scripts, toolchain discovery, or compilation setupcuda-oxideSIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, bookdocumentationImprovements or additions to documentationtestsAdds or improves test coverage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions