Skip to content

Expand CUDA/PTX docs, improve retrieval aliases, and add search regression suite#175

Open
qhy991 wants to merge 3 commits intoandrewyng:mainfrom
qhy991:chub-cuda-ptx-tags-2026-03-20
Open

Expand CUDA/PTX docs, improve retrieval aliases, and add search regression suite#175
qhy991 wants to merge 3 commits intoandrewyng:mainfrom
qhy991:chub-cuda-ptx-tags-2026-03-20

Conversation

@qhy991
Copy link

@qhy991 qhy991 commented Mar 20, 2026

Summary

Add comprehensive CUDA/PTX documentation and retrieval-quality infrastructure for Context Hub, with English-only content, richer PTX reference guidance, search alias tags, and a runnable search regression suite.

Changes

Documentation Expansion

  • Added many CUDA topic docs under content/cuda/docs/* (shared memory, synchronization, warp primitives, WMMA/Tensor Core, CUDA Core, performance and production playbooks).
  • Added PTX pattern docs:
    • content/cuda/docs/ptx-integer-bit-manipulation-patterns/DOC.md
    • content/cuda/docs/ptx-atomic-and-reduction-patterns/DOC.md
    • content/cuda/docs/ptx-mbarrier-protocol-patterns/DOC.md
    • content/cuda/docs/ptx-warp-synchronization-patterns/DOC.md
  • Expanded a large set of PTX reference pages with practical sections such as Usage Notes, Common Failure Modes, and protocol checklists.

Retrieval Improvements

  • Standardized PTX top-level doc language metadata to support --lang cpp retrieval paths while preserving PTX semantics.
  • Added search-friendly alias/synonym tags to high-frequency docs (WMMA/Tensor Core/shared memory/coalescing/synchronization/atomics/mbarrier topics), including terms like:
    • warp-matrix-multiply-accumulate, tensorcore, smem, coalesced-access, cas-loop, syncthreads.

Search Regression Suite

  • Added runnable regression tooling:
    • scripts/search_regression.py
    • scripts/search_regression_cases.json
    • scripts/search_regression_baseline.json
    • docs/features/search-regression.md
  • Includes 18 regression queries with top-k expectations for WMMA/shared-memory/tensor-core/PTX and optimization workflows.

What

This PR upgrades Context Hub from “basic CUDA/PTX coverage” to a retrieval-oriented, regression-tested documentation set designed for agent use.

Why

Problems addressed:

  • Sparse or uneven PTX reference pages reduced practical usefulness for agent-generated kernels.
  • Query phrasing variance (aliases/synonyms) could reduce retrieval quality.
  • No stable search regression gate existed to detect ranking drift after content updates.
  • Prior mixed-language artifacts and metadata mismatches could hurt consistency in local retrieval flows.

Testing

Content/Build Validation

  • ./cli/bin/chub build content --validate-only -> PASSED (1622 docs, 6 skills, 0 warnings)
  • ./cli/bin/chub build content -> PASSED

Search Regression

  • python3 scripts/search_regression.py --mode check -> PASSED (18/18)
  • python3 scripts/search_regression.py --mode snapshot --snapshot-out scripts/search_regression_baseline.json -> PASSED

Language Consistency

  • rg -n "[\p{Han}]" content/cuda/docs | wc -l -> 0

Notes

qhy991 added 3 commits March 20, 2026 17:51
Improve Context Hub retrieval for PTX/CUDA instruction references by providing translated content and searchable tags.

Made-with: Cursor
@qhy991 qhy991 changed the title Add English CUDA/PTX docs and searchable tags Expand CUDA/PTX docs, improve retrieval aliases, and add search regression suite Mar 21, 2026
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