Skip to content

Better cross-referencing and link validation#827

Open
Adrien-Tab wants to merge 5 commits into
kokkos:mainfrom
Adrien-Tab:static-batch-size
Open

Better cross-referencing and link validation#827
Adrien-Tab wants to merge 5 commits into
kokkos:mainfrom
Adrien-Tab:static-batch-size

Conversation

@Adrien-Tab
Copy link
Copy Markdown
Member

@Adrien-Tab Adrien-Tab commented Mar 13, 2026

  • Replace raw html links and substitutions with RST roles :doc:, :ref: and :cpp:
  • Add a Makefile target for link check

Signed-off-by: Adrien Taberner <adrien.taberner@cea.fr>
Copy link
Copy Markdown
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split the link fixing from the documenting the new trait.

Comment thread docs/Makefile Outdated
Comment on lines +8 to +9
linkcheck:
sphinx-build -b linkcheck ./source/ ./generated_docs/ -n -W --keep-going
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that going to run as part of the CI?
How expensive is it? Should that be just part of the html rule?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we currently don't. But I am for doing it if it is cheap

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only checks external links, and there are a lot of false positives.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know how to reduce the false positives?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just left it there so that developers can use it easily. I don't think it can be included in a CI

do we know how to reduce the false positives?

need to add the :doc: tag to some links

Signed-off-by: Adrien Taberner <adrien.taberner@cea.fr>
@Adrien-Tab Adrien-Tab changed the title Fix links and add StaticBatchSize section Fix external links Mar 13, 2026
Copy link
Copy Markdown
Contributor

@JBludau JBludau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things

Comment thread docs/source/get-started/requirements.rst
Comment thread docs/source/get-started/requirements.rst Outdated
Comment thread docs/Makefile Outdated
Comment on lines +8 to +9
linkcheck:
sphinx-build -b linkcheck ./source/ ./generated_docs/ -n -W --keep-going
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we currently don't. But I am for doing it if it is cheap

@Adrien-Tab Adrien-Tab marked this pull request as draft March 19, 2026 18:33
@Adrien-Tab
Copy link
Copy Markdown
Member Author

We should avoid substitutions for links. They are not verified at build time and cause false positives in linkcheck.

Use (all build-checked):

  • :doc: for entire pages (no code formatting)
  • :ref: for specific sections (no code formatting)
  • :cpp:function:/:cpp:class: for code symbols (code formatting applied)

Signed-off-by: Adrien Taberner <adrien.taberner@cea.fr>
Signed-off-by: Adrien Taberner <adrien.taberner@cea.fr>
@Adrien-Tab
Copy link
Copy Markdown
Member Author

(testing-and-issue-tracking/Kokkos-Project-Planning: line  122) broken    https://github.com/orgs/kokkos/projects/1 - 404 Client Error: Not Found for url: https://github.com/orgs/kokkos/projects/1

(ProgrammingGuide/SIMD: line    5) broken    https://www.researchgate.net/profile/Matthias_Kretz2/publication/295253746_Extending_C_for_Explicit_Data-Parallel_Programming_via_SIMD_Vector_Types/links/56c8c99208ae5488f0d6ffa0.pdf - 403 Client Error: Forbidden for url: https://www.researchgate.net/profile/Matthias_Kretz2/publication/295253746_Extending_C_for_Explicit_Data-Parallel_Programming_via_SIMD_Vector_Types/links/56c8c99208ae5488f0d6ffa0.pdf

(tutorials-and-examples: line   21) broken    https://www.exascaleproject.org/event/kokkos-class-series/ - 404 Client Error: Not Found for url: https://www.exascaleproject.org/event/kokkos-class-series/

@Adrien-Tab Adrien-Tab changed the title Fix external links Better cross-referencing and link validation Mar 23, 2026
@Adrien-Tab Adrien-Tab marked this pull request as ready for review March 23, 2026 17:16
@Adrien-Tab Adrien-Tab requested a review from Copilot March 23, 2026 17:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the documentation cross-referencing approach by replacing raw HTML/URL links and ad-hoc substitutions with Sphinx-native roles (:doc:, :ref:, :cpp:), and adds a make linkcheck target to validate links during docs builds.

Changes:

  • Converted many internal documentation links to Sphinx cross-references (:doc:, :ref:) and C++ domain roles (:cpp:).
  • Added/updated stable RST labels (anchors) to support :ref: links (e.g., known-issues sections, execution/memory space concepts).
  • Added a linkcheck target to docs/Makefile for automated link validation.

Reviewed changes

Copilot reviewed 97 out of 97 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/source/usecases/Moving_from_EnableUVM_to_SharedSpace.rst Switches SharedSpace-related references to :ref:-based substitutions.
docs/source/usecases/MDRangePolicy.md Updates external Intrepid documentation link.
docs/source/testing-and-issue-tracking/Testing-Processes.md Repoints tested-compiler link to local requirements doc.
docs/source/testing-and-issue-tracking/Kokkos-Project-Planning.md Updates meeting-notes repository links and wording.
docs/source/known-issues.rst Adds stable section labels and converts a doc link to :doc:.
docs/source/get-started/requirements.rst Includes shared defs and replaces external known-issues link with :ref:.
docs/source/get-started/package-managers.rst Converts configuration-guide link to :doc:.
docs/source/get-started/configuration-guide.rst Converts internal links to :doc:/:ref: (transition + known-issues).
docs/source/contributing.rst Converts LICENSE link to :doc:.
docs/source/ProgrammingGuide/View.rst Converts API references to :doc: and adds new anchor labels.
docs/source/ProgrammingGuide/ProgrammingModel.md Updates chapter reference number in narrative.
docs/source/ProgrammingGuide/ParallelDispatch.md Updates chapter reference numbers in narrative.
docs/source/ProgrammingGuide/Machine-Model.rst Replaces many legacy link substitutions with :doc:/:ref:/:cpp: and adds label(s).
docs/source/ProgrammingGuide/Initialization.rst Converts API links to :doc: and adjusts shell examples/code-block typing.
docs/source/API/core/view/view_like.rst Converts View-like links to :doc:.
docs/source/API/core/view/view.rst Replaces Programming Guide link with :ref:-based substitution.
docs/source/API/core/view/subview.rst Converts Kokkos::ALL reference to a doc link and removes _ usage.
docs/source/API/core/view/memoryTraits.rst Converts Programming Guide references to :ref:-based substitutions.
docs/source/API/core/view/deep_copy.rst Converts View/ExecutionSpace references to :doc:.
docs/source/API/core/view/create_mirror.rst Reworks concept/view references into :doc:/:ref: and inline C++ roles.
docs/source/API/core/view/Subview_type.rst Converts subview() reference to :doc: and removes _ usage.
docs/source/API/core/utilities/num_threads.rst Simplifies “See also” links using :doc:.
docs/source/API/core/utilities/num_devices.rst Simplifies “See also” links using :doc:.
docs/source/API/core/utilities/min_max_clamp.rst Simplifies “See also” links using :doc:.
docs/source/API/core/utilities/device_id.rst Simplifies “See also” links using :doc:.
docs/source/API/core/utilities/assert.rst Converts abort link to :doc:.
docs/source/API/core/spaces/partition_space.rst Converts execution_spaces reference into a :doc: link.
docs/source/API/core/profiling/scoped_region.rst Converts “See also” reference to :doc:.
docs/source/API/core/profiling/profiling_section.rst Converts “See also” reference to :doc:.
docs/source/API/core/policies/ThreadVectorRange.rst Converts multiple policy/concept links to :doc:.
docs/source/API/core/policies/ThreadVectorMDRange.rst Converts policy/concept links to :doc:.
docs/source/API/core/policies/TeamVectorRange.rst Converts policy/concept links to :doc:.
docs/source/API/core/policies/TeamVectorMDRange.rst Converts policy/concept links to :doc:.
docs/source/API/core/policies/TeamThreadRange.rst Converts policy/concept links to :doc:.
docs/source/API/core/policies/TeamThreadMDRange.rst Converts policy/concept links to :doc:.
docs/source/API/core/policies/TeamPolicy.rst Converts links to :doc:/:ref: and updates parallel_* references to :cpp:.
docs/source/API/core/policies/TeamHandleConcept.rst Updates external execution space URL.
docs/source/API/core/policies/RangePolicy.rst Converts “common arguments” link to :ref:.
docs/source/API/core/policies/NestedPolicies.rst Converts “common arguments” link to :ref:.
docs/source/API/core/policies/MDRangePolicy.rst Converts “common arguments” link to :ref:.
docs/source/API/core/policies/ExecutionPolicyConcept.rst Converts links to :doc: for guide + related APIs.
docs/source/API/core/parallel-dispatch/parallel_scan.rst Converts policy list and reduction_identity link to :doc:.
docs/source/API/core/parallel-dispatch/parallel_reduce.rst Reworks interface presentation and converts links to :doc:.
docs/source/API/core/parallel-dispatch/parallel_for.rst Converts ExecutionPolicy and policy list links to :doc:.
docs/source/API/core/parallel-dispatch/fence.rst Converts parallel_* and deep_copy references to :cpp: and concept link to :ref:.
docs/source/API/core/parallel-dispatch/ParallelScanTag.rst Converts reference to parallel_scan into :doc:.
docs/source/API/core/parallel-dispatch/ParallelReduceTag.rst Converts reference to parallel_reduce into :doc:.
docs/source/API/core/parallel-dispatch/ParallelForTag.rst Converts reference to parallel_for into :doc:.
docs/source/API/core/numerics/numeric-traits.rst Simplifies “See also” links using :doc:.
docs/source/API/core/numerics/mathematical-functions.rst Updates/normalizes links and converts known-issues reference to :doc:/:ref: usage.
docs/source/API/core/numerics/mathematical-constants.rst Converts known-issues reference to :ref: and see-also links to :doc:.
docs/source/API/core/memory_spaces.rst Converts concept links to :doc:/:ref: and adds labels for SharedSpace/HostPinned/concepts.
docs/source/API/core/execution_spaces.rst Converts concept links to :doc:/:ref: and adds a stable concept label.
docs/source/API/core/c_style_memory_management/realloc.rst Converts referenced functions/concepts to :cpp:/:doc:.
docs/source/API/core/c_style_memory_management/malloc.rst Converts referenced functions/concepts to :cpp:/:doc:.
docs/source/API/core/c_style_memory_management/free.rst Converts referenced functions to :cpp:.
docs/source/API/core/builtinreducers/Sum.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/ReducerConcept.rst Converts parallel_reduce + reducer list links to :doc:.
docs/source/API/core/builtinreducers/Prod.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/MinMaxLoc.rst Converts links to ReducerConcept/scalar type + guide references to :doc:.
docs/source/API/core/builtinreducers/MinMax.rst Converts links to ReducerConcept/scalar type + guide references to :doc:.
docs/source/API/core/builtinreducers/MinLoc.rst Converts links to ReducerConcept/scalar type + guide references to :doc:.
docs/source/API/core/builtinreducers/Min.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/MaxLoc.rst Converts links to ReducerConcept/scalar type + guide references to :doc:.
docs/source/API/core/builtinreducers/Max.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/LOr.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/LAnd.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/BOr.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtinreducers/BAnd.rst Converts links to ReducerConcept + guide references to :doc:.
docs/source/API/core/builtin_reducers.rst Converts index links to :doc: for concept + reducer entries.
docs/source/API/core/atomics/atomic_store.rst Converts “See also” links to :doc:.
docs/source/API/core/atomics/atomic_load.rst Converts “See also” links to :doc:.
docs/source/API/core/atomics/atomic_exchange.rst Converts “See also” links to :doc:.
docs/source/API/core/atomics/atomic_compare_exchange_strong.rst Converts deprecation pointer link to :doc:.
docs/source/API/core/atomics/atomic_compare_exchange.rst Converts “See also” link to :doc:.
docs/source/API/core/View.rst Converts View API index entries to :doc:.
docs/source/API/core/Traits.rst Converts concept links to :doc:/:ref:.
docs/source/API/core/Task-Parallelism.rst Converts guide links to :doc:.
docs/source/API/core/SpaceAccessibility.rst Converts ExecutionSpace/MemorySpace mentions to :doc: and refactors View/deep_copy mentions.
docs/source/API/core/Profiling.rst Converts profiling links to :doc:.
docs/source/API/core/ParallelDispatch.rst Converts dispatch function/tag links to :doc:.
docs/source/API/core/Macros.rst Converts execution-space mentions in tables to :doc:.
docs/source/API/core/KokkosConcepts.rst Replaces legacy substitutions with :doc: cross-references.
docs/source/API/core/Execution-Policies.rst Converts policy links to :doc: and adds a named anchor for common arguments.
docs/source/API/core-index.rst Converts core index entries to :doc: and fixes Traits link target.
docs/source/API/containers/ScatterView.rst Converts View reference to :doc:/C++ role style and updates parallel_reduce reference usage.
docs/source/API/containers/DualView.rst Converts View references to :doc:.
docs/source/API/containers-index.rst Converts containers index entries to :doc:.
docs/source/API/algorithms/std-algorithms/all/StdShiftRight.rst Converts cross-reference to shift_left into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdRemoveIf.rst Converts cross-reference to remove into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdRemoveCopyIf.rst Converts cross-reference to remove_copy into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdMinMaxElement.rst Converts cross-reference to min_element into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdMaxElement.rst Converts cross-reference to min_element into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdIsSortedUntil.rst Converts cross-reference to is_sorted into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdCopy_n.rst Converts cross-reference to copy into :doc:.
docs/source/API/algorithms/std-algorithms/all/StdCopyIf.rst Converts cross-reference to copy into :doc:.
docs/Makefile Adds linkcheck target using sphinx-build -b linkcheck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

-----

A Kokkos ScatterView serves as an interface for a standard Kokkos::|View|_ implementing a scatter-add pattern either via atomics or data replication.
A Kokkos ScatterView serves as an interface for a standard Kokkos:::cpp:class:`View` implementing a scatter-add pattern either via atomics or data replication.
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a malformed inline C++ domain reference here (Kokkos:::cpp:class:...). This will render incorrectly and may prevent Sphinx from resolving the reference. Update it to either plain Kokkos::View or a valid role like :cpp:class:Kokkos::View.

Suggested change
A Kokkos ScatterView serves as an interface for a standard Kokkos:::cpp:class:`View` implementing a scatter-add pattern either via atomics or data replication.
A Kokkos ScatterView serves as an interface for a standard ``Kokkos::View`` implementing a scatter-add pattern either via atomics or data replication.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +10
See :doc:`Profiling::ScopedRegion <profiling/scoped_region>` for details.`

Kokkos::Profiling::ProfilingSection
-----------------------------------
See `Profiling::ProfilingSection <profiling/profiling_section.html>`_ for details.`
See :doc:`Profiling::ProfilingSection <profiling/profiling_section>` for details.`
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentences end with an extra trailing backtick (...for details.), leaving an unmatched ` character. This is likely to cause an RST parsing warning/error. Remove the trailing backticks at the end of these lines.

Copilot uses AI. Check for mistakes.
Comment on lines +420 to 422
.. _scalbln: https://en.cppreference.com/w/cpp/numeric/math/scalbn

.. |scalbln| replace:: ``scalbln``
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The external reference target for scalbln points to the scalbn cppreference page. This makes the link incorrect. Update the URL to the correct cppreference page for scalbln.

Copilot uses AI. Check for mistakes.
Test configurations are defined in the `kokkos/.jenkins`, and `kokkos/.github/workflows/*` files and determine the official
primary software stack support.
The tested compiler versions are also listed [here](https://kokkos.github.io/kokkos-core-wiki/requirements.html).
The tested compiler versions are also listed [here](../get-started/requirements).
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Markdown link points to ../get-started/requirements without an extension or Sphinx cross-reference. In the built HTML this is likely to be a broken relative URL (it won't automatically resolve to requirements.html). Prefer a MyST/Sphinx doc link (e.g., {doc}/:doc:) to get-started/requirements so Sphinx can resolve it and linkcheck can validate it.

Copilot uses AI. Check for mistakes.
Comment on lines +164 to +165
Fortran
=======
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section title "Fortran" has a trailing space. This can lead to inconsistent rendering and makes diffs noisier. Remove the trailing whitespace in the heading text.

Copilot uses AI. Check for mistakes.
Signed-off-by: Adrien Taberner <adrien.taberner@cea.fr>
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.

4 participants